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/

    RSI Indicator and Real Time Data

    Indicators/Strategies/Analyzers
    2
    4
    406
    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.
    • Walt Weston
      Walt Weston last edited by

      So I just started using backtrader today and have been following the tutorial and watching videos and I have a couple questions, and I am trying to create a simple RSI bot. My first question is, if I use this code:

      self.rsi = bt.indicators.RSI_SMA(self.data.close, period=14)

      it returns a tuple....

      the documentation isn't very complete, which value is the current value of the RSI? is it say, rsi[0], rsi[1] etc....

      my second question is if I wanted to get the real time daily data of the RSI what would I need to do ? is RSI still computed over a 14 day average if I'm looking at the daily data? and if so , which feeds do I need to implement to get the current rsi data?

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        @Walt-Weston said in RSI Indicator and Real Time Data:

        it returns a tuple....

        it returns the line, array - Docs - Platform Concepts - Lines

        the documentation isn't very complete, which value is the current value of the RSI? is it say, rsi[0], rsi[1] etc....

        documentation is very good, just try to read it. and it clearly gives an answer on your question. latest value is self.rsi[0] - Docs - Platform Concepts - Indexing: 0 and -1

        my second question is if I wanted to get the real time daily data of the RSI what would I need to do ? is RSI still computed over a 14 day average if I'm looking at the daily data?

        you need to pass real time price data to bt and calculate rsi. If it will be daily bars and period will be 14, than it will be 14 days RSI value.

        and if so , which feeds do I need to implement to get the current rsi data?

        depends on the broker you are going to use for live trading. bt has implementation for ib, oanda and visual chart - Docs - Live Trading - Intro

        Walt Weston 1 Reply Last reply Reply Quote 1
        • Walt Weston
          Walt Weston @ab_trader last edited by

          @ab_trader thank you, answered my questions.

          A 1 Reply Last reply Reply Quote 0
          • A
            ab_trader @Walt Weston last edited by

            @Walt-Weston no problem

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