Navigation

    Backtrader Community

    • Register
    • 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/

    Indicator Woes

    Indicators/Strategies/Analyzers
    2
    2
    565
    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
      Self Quant last edited by Self Quant

      Backtrader Rookie here - I'm having issues calculating basic indicators using talib. My code it pretty straightforward (myrsi5.py) but I must be missing something as the RSI values that come out of backtrader don't match the actual RSI values. Thanks for your help on finding the discrepancy.
      Note: If I replace self.rsi = bt.talib.RSI( self.data.close, period=self.params.rsiperiod)
      with self.rsi = bt.indicators.RSI(self.data.close, period=self.params.rsiperiod)
      the RSI values are correct. So I must be either feeding the wrong information or the wrong order into the talib library/RSI calculation

      https://s3.amazonaws.com/backtrader.rsiwoes/myrsi5.py
      https://s3.amazonaws.com/backtrader.rsiwoes/SPY.csv

      B 1 Reply Last reply Reply Quote 0
      • B
        backtrader administrators @Self Quant last edited by

        @self-quant said in Indicator Woes:

        Note: If I replace self.rsi = bt.talib.RSI( self.data.close, period=self.params.rsiperiod)

        We don't know which values your output produces and why you think some are right and some are wrong. But I am pretty sure that the RSI indicator from talib doesn't take a period parameter. That could simply be it ...

        The TA-LIB docs: http://mrjbq7.github.io/ta-lib/doc_index.html

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }