Code Library / Supertrend

Pine Script Supertrend+RSI

Supertrend with RSI for high-probability entries.

Language: Pine Script · Category: Supertrend · Tags: supertrend, RSI, combo, Pine Script, high probability

Source code

//@version=5
strategy("ST+RSI",overlay=true)
[st,dir]=ta.supertrend(3,10); rsi=ta.rsi(close,14)
if dir<0 and ta.crossover(rsi,50)
    strategy.entry("Long",strategy.long)
if dir>0 and ta.crossunder(rsi,50)
    strategy.entry("Short",strategy.short)
plot(dir<0?st:na,"Up",color.green,2,plot.style_linebr)

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