For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
how to set the indicator data point value as nan
I want set the data point per 10 days, and connect the points, need set other data point value as NAN, hot to set it
class DummyInd(bt.Indicator): lines = ('dummyline',) plotinfo = dict(subplot=False,_skipnan=False) params = (('value', 0),('period', 1),) count =0 def __init__(self): self.lines.dummyline = numpy.nan #error here, do not know how to set. def next(self): DummyInd.count +=1 if DummyInd.count % 10==0: self.lines.dummyline = self.data.close
how to initial a line object as NaN, only set some points had value
I use this code implement it.
self.lines.dummyline = max(float('NaN'), float('NaN'))