-
Hello all, For some reason my Strategy class isn't iterating through the data using the
The print statement in I also checked all 4 of these series to see if there were at least 2 elements in there that weren't NaN, so I should see at least see one iteration in the Am I missing anything here? Let me know if you need anymore details. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You are assigning: self.tenkansens = self.I(self.tenkansen, h, l).s # type: pd.Series that is, the indicator but transformed into If you instead do it like this, it should work: def init(self):
self.tenkansens = self.I(self.tenkansen, h, l) # type: _Indicator
def next(self):
print(self.tenkansens.s.iloc[-1]) |
Beta Was this translation helpful? Give feedback.
You are assigning:
that is, the indicator but transformed into
pd.Series
, which makes it invisible to Backtest for iterative lengthening.If you instead do it like this, it should work: