OPEN-SOURCE SCRIPT

Lord Loren Strategy

//version=6
indicator("Lord Loren Strategy", overlay=true)

// EMA calculations
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
ema50 = ta.ema(close, 50)

// Plotting EMAs
plot(ema9, color=color.blue, title="EMA 9")
plot(ema21, color=color.orange, title="EMA 21")
plot(ema50, color=color.red, title="EMA 50")

// RSI calculation
rsiPeriod = 14
rsi = ta.rsi(close, rsiPeriod)

// Buy/Sell Conditions based on EMA Cross and RSI
buyCondition = ta.crossover(ema9, ema21) and rsi < 70
sellCondition = ta.crossunder(ema9, ema21) and rsi > 30

// Plot Buy/Sell signals
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")

// RSI plotting in the same script but with a secondary scale
plot(rsi, color=color.purple, title="RSI", offset=0)
hline(70, "Overbought", color=color.red, linestyle=hline.style_dotted)
hline(30, "Oversold", color=color.green, linestyle=hline.style_dotted)
Bands and Channels

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer