How to know the first index in the next function of indicator?
Meng Xiaofeng last edited by
I am trying to make my own indicator in which i want to find which bar in the history is higher than current high.
how do I know which one is the first bar( -1, -2, -3 ....) so that the loop can have a end point?
class MyInd(bt.Indicator): lines = ('example',) def next(self): for (i = -1; i > ?; i--) if self.data.high[i] > self.data.high: distance = -i; break;
Meng Xiaofeng last edited by Meng Xiaofeng
many thanks for anwser!
but still the question: is it possible to get the first index and use the index explicitly?
lenof the data to know how many items are available.