File tree 1 file changed +1
-7
lines changed
1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -441,13 +441,7 @@ def set_trailing_sl(self, n_atr: float = 6):
441
441
442
442
def next (self ):
443
443
super ().next ()
444
- """
445
- self.data in init() is different from self.data in next(). self.data in init() has all the data.
446
- while the one in next() gets accumulated data over iterations. i.e. 5 iterations -> 5 data. n iteration -> n data.
447
- so doing self.data.Close[-1] in next() gets you the last record.
448
- but the same is not true for self.__atr, because self.__atr always has fully computed set from init(),
449
- so we need to use absolute index while accessing atr value from self.__atr.
450
- """
444
+ # Can't use index=-1 because self.__atr is not an Indicator type
451
445
index = len (self .data )- 1
452
446
for trade in self .trades :
453
447
if trade .is_long :
You can’t perform that action at this time.
0 commit comments