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 …

XAUUSD vs DXY: Can Gold Rebound From $3,471?

XAUUSD vs DXY: Can Gold Rebound From $3,471? U.S. Dollar Currency Index TVC:DXY Serana2324 Gold came under heavy selling pressure on November 20, with spot prices falling to $3,513.54 intraday. On the 12H charts, I’m watching whether gold can defend $3,471.36 as the U.S. Dollar Index approaches 104.43 resistance. What pressured gold? 1. December Fed rate hike expectations. Expectations of […]

AVAX update

AVAX update Avalanche / USDC COINBASE:AVAXUSDC MtICHI AVAX price is constrained by overall crypto market weakness and its own lack of narrative catalysts, trading in the low $7 range. Short-term focus should be on whether the $7 support level holds; medium-to-long-term, attention should be on whether Helicon’s institutional-friendly features can translate into sustained on-chain activity growth and new capital inflows.

Deixe um comentário

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