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



  • 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?



  • @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



  • @ab_trader thank you, answered my questions.



  • @Walt-Weston no problem


Log in to reply
 

});