Code Library / RSI Strategies

Pine Script Multi-TF RSI

Multi-timeframe RSI from multiple timeframes for confluence.

Language: Pine Script · Category: RSI Strategies · Tags: RSI, multi-timeframe, MTF, Pine Script, confluence

Source code

//@version=5
indicator("Multi-TF RSI",overlay=false)
rsi_c=ta.rsi(close,14)
rsi_15=request.security(syminfo.tickerid,"15",ta.rsi(close,14))
rsi_1h=request.security(syminfo.tickerid,"60",ta.rsi(close,14))
rsi_4h=request.security(syminfo.tickerid,"240",ta.rsi(close,14))
plot(rsi_c,"Current",color.blue,2); plot(rsi_15,"15m",color.orange)
plot(rsi_1h,"1H",color.purple); plot(rsi_4h,"4H",color.red)
hline(70); hline(30); hline(50)

How to use this snippet

This is a building block, not a finished trading system. Paste it into your own Pine Script project, compile it, and test it on a demo account with your broker's real spreads before relying on it. You can convert it to MQL4 or MQL5 with the Pine Script converter.

Related snippets