Is it possible to do nested talib indicators?



  • I would like to do something like the the LINEARREG of the output of another talib indicator. Is this possible directly, or do I need to just make my own indicator that combines them?

    Thanks.



  • Have you tried? It seems the TA-Lib indicators you see are automatically generated wrappers around TA-Lib. As such the behavior should be the same as seen in the docs and example.

    sma = bt.ind.SMA(self.data, period=10)
    sma_on_sma = bt.ind.SMA(period=5)
    

    and

    ta_sma = bt.talib.SMA(self.data, timeperiod=self.p.period)
    ta_sma_on_ta_sma = bt.talib.SMA(ta_sma_on_ta_sma, timeperiod=self.p.period)
    #or 
    sma_on_ta_sma = bt.SMA(ta_sma_on_ta_sma, timeperiod=self.p.period)
    

Log in to reply
 

Looks like your connection to Backtrader Community was lost, please wait while we try to reconnect.