A clean trend overlay that combines five EMAs (9/21/50/100/200) with a color-switched Supertrend and simple BUY/SELL labels from the EMA-9 × EMA-21 crossover. It’s built to show structure (EMAs), direction (Supertrend), and timing (crossovers) without clutter.
Features
- EMAs 9, 21, 50, 100, 200 for short-to-long trend structure and dynamic support/resistance.
- Supertrend line, green in uptrends and red in downtrends.
Signals:
- BUY when EMA-9 crosses above EMA-21 (blue label below the bar).
- SELL when EMA-9 crosses below EMA-21 (yellow label above the bar).
- Lightweight overlay on the main chart pane.
Inputs
- Source: price series used for calculations (default: Close).
- EMA lengths: 9, 21, 50, 100, 200.
- ATR Length (Supertrend): default 10.
- Factor (Supertrend): default 4.0 (higher = fewer flips).
- ATR MA type: RMA, SMA, EMA, or WMA (default: RMA).
How it works
- EMAs are standard exponential moving averages on the selected source.
- Supertrend uses ATR(ATR Length) × Factor; direction sets color (green up, red down).
- Signals fire on bar close when:
- BUY: EMA-9 current > EMA-21 current and EMA-9 previous ≤ EMA-21 previous.
- SELL: EMA-9 current < EMA-21 current and EMA-9 previous ≥ EMA-21 previous.
- Warm-up: EMAs and Supertrend need a few bars before everything displays.
How to use
- Read the EMA “fan” for overall bias; wider separation usually means stronger trend.
- Favor trades in Supertrend direction (green for long bias, red for short bias).
- Treat BUY/SELL labels as timing cues; confirm with price action or higher-timeframe context.
- Manage risk normally (position sizing, stops, and invalidation levels).
Tuning tips
- Seeing chop or frequent flips? Increase Factor (e.g., 4 → 5–6) and/or ATR Length (e.g., 10 → 14).
- Directional filter: act on BUYs mainly when above EMA-200 and Supertrend is green; SELLs mainly when below EMA-200 and Supertrend is red.
- Multi-timeframe check: align entries on lower timeframes with higher-timeframe trend.
Notes
- Price-scale label visibility depends on platform settings/build; if a hide option doesn’t remove them, that’s platform behavior, not the script logic.
- On very short histories or illiquid symbols, expect a brief initialization period before lines and signals appear.
Changelog
- v1.0 — Initial public release: 5× EMAs, color-switched Supertrend, EMA-9 × EMA-21 BUY/SELL labels.
Comments