For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

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?


  • 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(, period=10)
    sma_on_sma = bt.ind.SMA(period=5)


    ta_sma = bt.talib.SMA(, timeperiod=self.p.period)
    ta_sma_on_ta_sma = bt.talib.SMA(ta_sma_on_ta_sma, timeperiod=self.p.period)
    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.