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

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:
    https://github.com/mementum/bta-lib/blob/master/btalib/indicators/cci.py

    BackTrader Indicator script that produces CCI outputs that don't match my TradingView 'source of truth':
    https://github.com/mementum/backtrader/blob/master/backtrader/indicators/cci.py


Log in to reply
 

});