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

Differing CCI Outputs bta-lib vs Backtrader.Indicators

  • Good Morning,

    I'm getting differing CCI values from bta-lib compared to backtrader.indicators CCI output values when I run them on the same data set. When comparing the values against TradingView (my source of truth in this excercise), the bta-lib CCI outputs are matching and are what I would like to utilize for my BackTrader strategy. Is there a known bta-lib integration into BackTrader so that I can call on bta-lib indicators? In looking at the indicator source code (links below) there are some variations, but I'm not able to adjust the backtrader.indicator CCI code to reflect the bta-lib CCI output. Any recommendations on how to implement the bta-lib CCI into BackTrader strategies?

    bta-lib CCI script that is what I'd like to replicate in my BackTrader Strategy:

    BackTrader Indicator script that produces CCI outputs that don't match my TradingView 'source of truth':

Log in to reply