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 get the date of date in indicator?
-
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 It would be convenient if could get the date of the date during debug.
-
@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
-
-
@ab_trader Thank you.
What I mean is get datetime in indicator once function.
I figure out a solution, which is pass strategy.datas[0].datetime as a data, so I can access the date by bt.num2date(self.datas[1][i])
I don't know if it is a good one, but it works
Regards