xmd79

Multi-Timeframe RSI

May 24th, 2023
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1.  
  2. //@version=5
  3. indicator(title='Multi-Timeframe RSI', overlay=false)
  4.  
  5. // RSI Inputs
  6. length = input(14, title='RSI Length')
  7.  
  8. inp = input(close)
  9.  
  10. // Calculate RSI on the hourly timeframe
  11. rsi_hourly = ta.rsi(inp, length)
  12. plot(rsi_hourly, color=color.new(color.blue, 0), title='RSI Hourly')
  13.  
  14. // Calculate RSI on the 15-minute timeframe
  15. rsi_15min = request.security(syminfo.tickerid, '15', ta.rsi(close, length))
  16. plot(rsi_15min, color=color.new(color.red, 0), title='RSI 15-Minute')
  17.  
  18. // Calculate RSI on the 5-minute timeframe
  19. rsi_5min = request.security(syminfo.tickerid, '5', ta.rsi(close, length))
  20. plot(rsi_5min, color=color.new(color.green, 0), title='RSI 5-Minute')
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment