Backtrader Community

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    bta-lib and bt.indicators deliver different values when using indicator on indicator

    bta-lib
    1
    2
    589
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      soultrader last edited by

      I am thankfully using bta-lib in computing indicators the right way and to make sure they are equivalent to what is being used in Backtrader. When using single indicators like RSI, ATR, MACD, the values are exactly the same in bta-lib and Backtrader, as expected.

      However, when I use an indicator on indicator approach, like a RSI on ATR, there is a rather large discrepancy between values. The source values, in this case ATR, are similar.

      The Backtrader indicator (RSI on ATR) seems to deliver the correct value in my opinion.

      Any suggestions?

      S 1 Reply Last reply Reply Quote 0
      • S
        soultrader @soultrader last edited by

        Found the culprit.

        When examing the ATR dataframe returned from the bta-lib ATR function it contains NaN.
        After removing the NaN values from the dataframe I got the same results.

        RSI(atr_df.dropna(), period=7)

        1 Reply Last reply Reply Quote 2
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors