EMA 9/26 Cross (Signals + Alerts)What it calculates
EMA 9 (fast) and EMA 26 (slow) on whatever price source you pick (default: close).
It watches for two events:
Bullish cross (BUY): EMA 9 crosses above EMA 26 (ta.crossover)
Bearish cross (SELL): EMA 9 crosses below EMA 26 (ta.crossunder)
What you see on the chart
Two EMA lines (fast + slow), plotted on the price chart (overlay=true).
Optional markers:
A triangle up under the candle labeled BUY on bullish cross.
A triangle down above the candle labeled SELL on bearish cross.
What you can customize (inputs)
Source (close, open, hl2, etc.)
Fast EMA length (defaults to 9)
Slow EMA length (defaults to 26)
Toggle to show/hide EMAs
Toggle to show/hide markers
Alerts (the important part)
It defines two alertcondition() rules:
“EMA 9/26 Bullish Cross” fires exactly when the bullish crossover happens.
“EMA 9/26 Bearish Cross” fires exactly when the bearish crossunder happens.
So in TradingView you can create alerts like:
Notify/push/email/webhook when BUY happens
Notify/push/email/webhook when SELL happens
What it does not do
It doesn’t place trades or track performance (no entries/exits, no P&L).
It won’t “stay long” or “stay short”—it only flags the moment of the cross.
If you want, I can modify Option A to:
only alert on confirmed bar close (to avoid intrabar “false crosses”),
add trend filter (e.g., only BUY if price > EMA200),
or add a cooldown so it won’t spam signals in choppy markets.
อินดิเคเตอร์ Pine Script®






















