-
-
Couldn't load subscription status.
- Fork 1.3k
Dont start "def next(self):" #1077
-
Hello.
I have a problem adding an indicator. I created an indicator (self.start_position_ind) that I add from Numpy (from file). It is drawn on the graph (red dot), but "def next(self): don't working"
def init(self):
super().init()
super().set_trailing_sl(self.sl_PrStop, self.ts_PrStop)
self.start_position = get_start_position()
self.start_position_ind = self.I(lambda: self.start_position, name="Отметки времени", overlay=False, scatter=True, color="#ff0000")
self.min_line_funk = self.I(lambda: self.min_line_ind, name="Уровень", overlay=True, scatter=False)
def next(self):
super().next()
print("Test")
I left only this "print("Test") " in def next and it doesn’t work. The "Test" is not displayed.
Before adding this indicator, everything worked perfectly, as soon as I remove this indicator, everything works again.
What could be the problem?
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
Surprisingly, I found the answer to my question on my own. The reason is that I add the first tag with the indicator at the very end of the data.... And the reason for this is the following:"
.. warning:: You may obtain different results for different strategy parameters. E.g. if you use 50- and 200-bar SMA, the trading simulation will begin on bar 201. The actual length of delay is equal to the lookback period of theStrategy.I indicator which lags the most. Obviously, this can affect results. """
:)
Beta Was this translation helpful? Give feedback.
All reactions
-
😄 1