PROTECTED SOURCE SCRIPT

EMA Cross 5/21 with Accurate Break Triangles & Clean Prev OHLC

31
EMA Cross 5/21 with Structure Break & OHLC Levels

Purpose

This strategy combines EMA crossovers with market structure breakouts for more reliable trade signals.
It enhances trade context by plotting Previous Day and Previous Week key levels (Open, High, Low, Close), which are widely used for intraday decision-making.

Core Components

1. EMA Trend Filter
Uses a fast EMA (5) and a slow EMA (21).
Bullish bias: EMA 5 crosses above EMA 21.
Bearish bias: EMA 5 crosses below EMA 21.
EMA cross serves as the initial momentum shift signal.

2. Market Structure Break Confirmation

After an EMA cross, the script looks for a structure break within 3 candles:
Bullish Break: Price closes above the most recent swing high.
Bearish Break: Price closes below the most recent swing low.
Swing points are determined using a 3-bar lookback on each side.
This confirmation filters out false EMA crosses that occur during consolidation.

3. Entry Signal Visualization

Green triangle below the bar = Bullish structure break within 3 bars after bullish EMA cross.
Red triangle above the bar = Bearish structure break within 3 bars after bearish EMA cross.
These markers appear only when both EMA direction and structure break agree.

4. Key Market Levels (Support/Resistance)

The script automatically draws straight horizontal reference lines for:
Previous Day OHLC:
PDO – Previous Day Open (Blue)
PDC – Previous Day Close (Yellow)
PDH – Previous Day High (Red)
PDL – Previous Day Low (Green)
Previous Week OHLC (lighter shades):
PWO – Previous Week Open (Light Blue)
PWC – Previous Week Close (Light Yellow)
PWH – Previous Week High (Light Red)
PWL – Previous Week Low (Light Green)
These levels help traders identify:
Potential support/resistance zones.
High-probability breakout or reversal points.
Institutional liquidity levels.

Trading Logic

Wait for EMA cross to set bias (bullish or bearish).
Within 3 bars, check for a break of the last swing high/low in the direction of bias.
Plot signal (green triangle up for bullish, red triangle down for bearish).
Use PD/PW levels as confluence zones for entry, stop placement, or target setting.

Advantages

Filters out many false signals from simple EMA cross strategies.
Adds market structure awareness.
Automatically integrates important daily/weekly reference levels.
Signals are visually intuitive for faster decision-making.

Best Use Cases

Intraday trading: Using PD/PW levels for scalping or day trades.
Swing trading: Waiting for higher timeframe EMA cross + structure break confirmation.
Breakout trading: Combining PDH/PDL or PWH/PWL breaks with EMA confirmation.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.