RSI + EMA Strategy

RSI + EMA Strategy

20 Microns Limited NSE_DLY:20MICRONS



//@version=5
indicator(“Long-Term Indian Equities: 10/40 EMA + 14 RSI”, overlay=true)

// — Inputs —
fastLen = input.int(10, title=”Fast EMA Length”)
slowLen = input.int(40, title=”Slow EMA Length”)
rsiLen = input.int(14, title=”RSI Length”)

// — Calculations —
ema10 = ta.ema(close, fastLen)
ema40 = ta.ema(close, slowLen)
rsi14 = ta.rsi(close, rsiLen)

// — Plot EMAs —
plot(ema10, title=”10 EMA”, color=color.new(color.teal, 0), linewidth=2)
plot(ema40, title=”40 EMA”, color=color.new(color.orange, 0), linewidth=2)

// — Signal Logic (Weekly Chart Optimized) —
// Buy: Uptrend intact (Price & 10 EMA > 40 EMA) AND RSI pulls back into 40-48 zone and turns up
uptrend = close > ema40 and ema10 > ema40
rsiBuy = rsi14 >= 40 and rsi14 <= 48 and rsi14 > rsi14
buySignal = uptrend and rsiBuy and not rsiBuy

// Deep Value Buy: Oversold bounce below 32 RSI
deepBuy = ta.crossover(rsi14, 32)

// Sell / Trim: Extreme euphoria (RSI > 80) OR structural trend break (2 weekly closes below 40 EMA)
trimSignal = ta.crossunder(rsi14, 80)
exitSignal = close < ema40 and close < ema40 and close >= ema40

// — Plot Signals on Chart —
plotshape(buySignal, title=”Trend Buy”, location=location.belowbar, color=color.green, style=shape.labelup, text=”BUY”, textcolor=color.white, size=size.small)
plotshape(deepBuy, title=”Deep Value Buy”, location=location.belowbar, color=color.blue, style=shape.labelup, text=”VALUE BUY”, textcolor=color.white, size=size.small)
plotshape(trimSignal, title=”Trim Profits”, location=location.abovebar, color=color.orange, style=shape.labeldown, text=”TRIM”, textcolor=color.white, size=size.small)
plotshape(exitSignal, title=”Trend Exit”, location=location.abovebar, color=color.red, style=shape.labeldown, text=”EXIT”, textcolor=color.white, size=size.small)

// — Alerts —
alertcondition(buySignal or deepBuy, title=”Long-Term Buy Alert”, message=”Buy/Accumulate Signal Triggered on {{ticker}}”)
alertcondition(trimSignal or exitSignal, title=”Long-Term Sell/Trim Alert”, mes

Previous Article

[XAUUSD] M30: Can 3,600 Hold the Recovery?

Next Article

GOLD HOLDS 3,600 – CAN BUYERS REACH 3,750?

You might be interested in …

FCPO : An interesting junction

FCPO : An interesting junction Crude Palm Oil Futures MYX:FCPO1! micchua FCPO had a complex correction that lasted 237 trading weeks which happens to be 1.618 of the time taken for the bull market from July 2019 to August 2022 (146 trading weeks). The 237th bar traded through the lower channel momentarily bouncing off suggesting respect for the channel and […]

XRPUSDT 1D

XRPUSDT 1D XRP / TetherUS BINANCE:XRPUSDT Hamedzare2020 XRPUSDT – Daily Outlook | Bearish Scenario The overall market structure remains bearish, with XRP showing continued weakness after failing to sustain its recovery. A breakdown below the $0.96 support zone could trigger further downside, with $0.7147 as the primary target. Any short-term rebound toward the $0.9855–$1.0143 resistance zone should be viewed as […]

GER40

GER40 Germany 40 CFD FOREXCOM:GER40 HUNTER-FX1 Its still selling because we are in last quarter and its reversing

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *