Indicator Woes
-
Backtrader Rookie here - I'm having issues calculating basic indicators using talib. My code it pretty straightforward (myrsi5.py) but I must be missing something as the RSI values that come out of backtrader don't match the actual RSI values. Thanks for your help on finding the discrepancy.
Note: If I replace self.rsi = bt.talib.RSI( self.data.close, period=self.params.rsiperiod)
with self.rsi = bt.indicators.RSI(self.data.close, period=self.params.rsiperiod)
the RSI values are correct. So I must be either feeding the wrong information or the wrong order into the talib library/RSI calculationhttps://s3.amazonaws.com/backtrader.rsiwoes/myrsi5.py
https://s3.amazonaws.com/backtrader.rsiwoes/SPY.csv -
@self-quant said in Indicator Woes:
Note: If I replace self.rsi = bt.talib.RSI( self.data.close, period=self.params.rsiperiod)
We don't know which values your output produces and why you think some are right and some are wrong. But I am pretty sure that the
RSI
indicator fromtalib
doesn't take aperiod
parameter. That could simply be it ...The
TA-LIB
docs: http://mrjbq7.github.io/ta-lib/doc_index.html