Hello, I am trying to create an indicator that takes the output of the ZeroLagIndicator and passes it to RSI as the input, tried several ways but can't figure out how to correctly pass the data between them.
When I run the code example I can see the correct value for zerolag printed out, but nan for RSI.
class MyIndicator(bt.Indicator): def __init__(self, data): self.zerolag = bt.indicators.ZeroLagIndicator( data,) self.rsi = bt.indicators.RSI(self.zerolag, period=5) def next(self): print("zerolag=" + str(self.zerolag)) print("rsi=" + str(self.rsi))
What is the correct way of doing this? Any help would be highly appreciated.