I want to use the heikin ashi data into the indicators, for example, i want to use the weighted moving avarage and the RSI also based to the Hekin Ashi data.
I've tried to wrote this:
self.sma=bt.indicators.SimpleMovingAverage(self.hk.close[0], period=self.params.speriod)
but is not working. Is giving me:
AttributeError: 'Lines_LineSeries_LineIterator_DataAccessor_Strateg' object has no attribute 'ha_close'
I've tried also in that way:
def __init__(self):
self.ha_close=bt.indicators.HeikinAshi()
self.startcash=self.broker.getvalue()
self.ema=bt.indicators.WeightedMovingAverage(
self.ha_close[0],period=self.params.period)
IndexError: array index out of range
And another question because on internet (https://backtest-rookies.com/2018/01/26/backtrader-working-heikin-ashi/) i found a tutorial that explain one strategy code but is using hk.close instead of ha_close that you told me.
P.S. I'm sorry if my question are so obviously for a lot of people. I'm pretty new and here is look like one of the only place that somebody can help me