Buy and sell alerts using Ema's***What this indicator does:***
1) It calculates two EMAs and an RSI
emaS = short EMA (default 9) → reacts faster to price
emaL = long EMA (default 21) → reacts slower, defines trend bias
rsi = RSI (default 14) → momentum confirmation
2) It defines a “trend state” (bull/bear) with optional RSI confirmation
Bull trend when:
9 EMA is above 21 EMA AND
RSI is ≥ 55 (only if useRSI = true)
Bear trend when:
9 EMA is below 21 EMA AND
RSI is ≤ 45 (only if useRSI = true)
This is why you see the green/red background tint—it’s marking the current trend state.
3) It generates Buy/Sell signals on EMA crossovers (plus optional RSI filter)
Buy signal happens only when:
9 EMA crosses above 21 EMA, and
RSI is ≥ 55 (if enabled)
Sell signal happens only when:
9 EMA crosses below 21 EMA, and
RSI is ≤ 45 (if enabled)
**Best timeframe to use (to reduce false signals)**
Because this is a crossover system, it will always whipsaw in chop—lower timeframes whip more.
✅ Best overall: 15-minute
Best balance of signal quality and frequency
EMA crosses mean more when candles are “real” and not micro-noise
RSI confirmation works better
Also very good: 5-minute (if you trade intraday a lot)
More signals than 15m, still usable
Expect some chop during lunchtime / ranges
Cleanest but fewer trades: 1-hour
Very low noise, great for swing/intraday trend holds
Fewer entries, but highest reliability
Avoid (unless you add filters): 1-minute / 3-minute
EMA crosses happen constantly in chop
RSI thresholds (55/45) get hit too easily and still whipsaw
My default recommendation:
Day trading: 15m
Faster scalps: 5m (with a filter)
Swing/position: 1h
*** Some Indicators that pair well with this (and why)***
1) ADX (Trend Strength Filter) — top pairing
Use ADX to avoid taking signals in chop.
Only take buys/sells when ADX > 18–25
If ADX is low, ignore EMA crosses (they’ll whipsaw)
2) VWAP (Intraday Bias Filter) — best for stocks/indices intraday
Prefer BUY only if price is above VWAP
Prefer SELL only if price is below VWAP
This cuts a ton of false signals on 5m/15m.
3) ATR (Stop/Target + Volatility Filter)
Not for entries—use it for:
Stop placement (e.g., 1–1.5× ATR)
Profit targets or trailing stops
Also helps you avoid tiny-chop sessions where ATR is very low.
4) Higher Timeframe Trend Filter (simple but powerful)
Example:
Trade 15m signals only in the direction of the 1h EMA trend
This is one of the easiest ways to reduce false trades.
5) Support/Resistance / Pivot Points
EMA cross signals work best when they break/hold key levels.
Use daily pivots, prior day high/low, OR key S/R zones
Take signals that align with a break + retest
The EMA’s alert with Buy/Sell Levels (v2) is a simple trend-following indicator designed to help traders identify directional bias and high-probability buy and sell opportunities using moving averages and momentum confirmation.
The script combines:
A fast and slow Exponential Moving Average (EMA) crossover for trend direction
An optional RSI confirmation filter to reduce false signals
Visual trend highlighting and clear on-chart buy/sell labels
Built-in alert conditions for automation and notifications
How It Works
Bullish Trend
Short EMA is above the Long EMA
RSI is above the user-defined buy threshold (default: 55)
Bearish Trend
Short EMA is below the Long EMA
RSI is below the user-defined sell threshold (default: 45)
Buy Signal
Short EMA crosses above Long EMA
RSI confirms bullish momentum (if enabled)
Sell Signal
Short EMA crosses below Long EMA
RSI confirms bearish momentum (if enabled)
The background color visually reflects the current trend state:
Green = Bullish
Red = Bearish
Recommended Timeframes
15-minute – Best balance of reliability and signal quality
5-minute – Faster signals (recommended with additional filters like VWAP or ADX)
1-hour – Higher-confidence swing and trend trades
Lower timeframes may produce more false signals due to market noise.
Best Use Cases
Trend continuation trades
Momentum breakouts
Intraday and swing trading
Important Notice: This indicator is intended for educational and informational purposes only.
It is not financial or investment advice. Market conditions can change rapidly, and no indicator can guarantee profitable results. Always use proper risk management and confirm signals with additional analysis before making any trading or investment decisions. You are solely responsible for any trades you place using this indicator.
อินดิเคเตอร์ Pine Script®






















