@yacc-don Sorry, It would be convenient if I could get the date of the "data", could anybody tell me how to do it?
class _DwtBase(bt.Indicator):
def once(self, start, end):
print( self.datas[0][j].date )
Thansk
@yacc-don Sorry, It would be convenient if I could get the date of the "data", could anybody tell me how to do it?
class _DwtBase(bt.Indicator):
def once(self, start, end):
print( self.datas[0][j].date )
Thansk
@yacc-don It would be convenient if could get the date of the date during debug.
It would be convenient if I could get the date of the date, could anybody tell me how to do it?
For example:
class _DwtBase(bt.Indicator):
def once(self, start, end):
print( self.dates[0][j].date )
Regards.
@Yacc-Don Or you are testing if it is Nan. Is it equivalent to math.isnan()?
self.lines.zigzag[idx] = (self.zigzag_peak[idx] - absplotdist) if self.zigzag_peak[idx] == self.zigzag_peak[idx] else (self.zigzag_valley[idx] + absplotdist) if self.zigzag_valley[idx] == self.zigzag_valley[idx] else float('NaN')
self.lines.zigzag[idx] = (self.zigzag_peak[idx] - absplotdist) if True else (self.zigzag_valley[idx] + absplotdist) if True else float('NaN')
Thank for sharing.
About your former version of zigzag code, what's the difference with these two line of the code?
@bigdavediode said in Zigzag Indicator:
self.lines.zigzag[idx] = (self.zigzag_peak[idx] - absplotdist) if self.zigzag_peak[idx] == self.zigzag_peak[idx] else (self.zigzag_valley[idx] + absplotdist) if self.zigzag_valley[idx] == self.zigzag_valley[idx] else float('NaN') self.lines.zigzag[idx] = (self.zigzag_peak[idx] - absplotdist) if True else (self.zigzag_valley[idx] + absplotdist) if True else float('NaN')
Thanks for sharing.
I have a question, what's the difference between the two lines of the code.