Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dont start "def next(self):" #1077

Unanswered
lapitskaya38 asked this question in Q&A
Discussion options

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"

image

 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?

You must be logged in to vote

Replies: 1 comment

Comment options

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. """
:)

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /