OPEN-SOURCE SCRIPT
3 EMA + HH/LL Structure Break [ Trend and Structure combined] v2

3EMA PRO V2 is a structured EMA + market-structure indicator designed for intraday trading on instruments such as XAUUSD and BTCUSD.
The system combines 20 EMA, 50 EMA and 100 EMA with 10/10 pivot-based market structure to identify trend-following and reversal opportunities.
🔹 Core EMA Logic
Trend Following BUY
100 EMA is below both 20 EMA and 50 EMA.
20 EMA crosses above 50 EMA.
The system looks for confirmation through market structure.
Trend Following SELL
100 EMA is above both 20 EMA and 50 EMA.
20 EMA crosses below 50 EMA.
The system looks for bearish structure confirmation.
Reversal BUY
Fast and middle EMA move/cross above the 100 EMA.
Used to identify potential bullish reversal conditions.
Reversal SELL
Fast and middle EMA move/cross below the 100 EMA.
Used to identify potential bearish reversal conditions.
🔹 Market Structure Confirmation
The indicator uses 10 Left / 10 Right pivots to identify:
HH — Higher High
HL — Higher Low
LH — Lower High
LL — Lower Low
The important concept is EMA signal + structure confirmation, rather than taking every EMA crossover immediately.
If the EMA signal appears before the structure break, the system waits for the corresponding HH/LL breakout candle to close.
If the structure break happens before the EMA signal, the system waits for the EMA confirmation and then looks for a neckline retest before entry.
🔹 Entry
The indicator provides:
🟢 BUY labels
🔴 SELL labels
Entry price
SL
TP1
TP2
TP3
Reversal / Trend classification
🔹 Risk Management
TP and SL are fully configurable in dollar values.
You can independently adjust:
TP1 ($)
TP2 ($)
TP3 ($)
SL ($)
Position size
🔹 Backtest Statistics
The indicator includes an internal last 500 signals performance table, displaying:
Total signals
Win rate
Wins / losses
Break-even trades
Net P/L
Profit Factor
Maximum drawdown
BUY / SELL count
Reversal / Trend count
TP1 / TP2 / TP3 hits
SL hits
Current EMA and pivot settings
⚠️ Important
This indicator is intended as a technical analysis and decision-support tool, not a guarantee of profitable trading. Backtest results can vary significantly depending on the symbol, timeframe, spread, commission, slippage and execution conditions.
Suggested starting configuration:
EMA: 20 / 50 / 100
Pivot: 10 / 10
Markets: XAUUSD / BTCUSD
Timeframes: 1M / 5M
The system combines 20 EMA, 50 EMA and 100 EMA with 10/10 pivot-based market structure to identify trend-following and reversal opportunities.
🔹 Core EMA Logic
Trend Following BUY
100 EMA is below both 20 EMA and 50 EMA.
20 EMA crosses above 50 EMA.
The system looks for confirmation through market structure.
Trend Following SELL
100 EMA is above both 20 EMA and 50 EMA.
20 EMA crosses below 50 EMA.
The system looks for bearish structure confirmation.
Reversal BUY
Fast and middle EMA move/cross above the 100 EMA.
Used to identify potential bullish reversal conditions.
Reversal SELL
Fast and middle EMA move/cross below the 100 EMA.
Used to identify potential bearish reversal conditions.
🔹 Market Structure Confirmation
The indicator uses 10 Left / 10 Right pivots to identify:
HH — Higher High
HL — Higher Low
LH — Lower High
LL — Lower Low
The important concept is EMA signal + structure confirmation, rather than taking every EMA crossover immediately.
If the EMA signal appears before the structure break, the system waits for the corresponding HH/LL breakout candle to close.
If the structure break happens before the EMA signal, the system waits for the EMA confirmation and then looks for a neckline retest before entry.
🔹 Entry
The indicator provides:
🟢 BUY labels
🔴 SELL labels
Entry price
SL
TP1
TP2
TP3
Reversal / Trend classification
🔹 Risk Management
TP and SL are fully configurable in dollar values.
You can independently adjust:
TP1 ($)
TP2 ($)
TP3 ($)
SL ($)
Position size
🔹 Backtest Statistics
The indicator includes an internal last 500 signals performance table, displaying:
Total signals
Win rate
Wins / losses
Break-even trades
Net P/L
Profit Factor
Maximum drawdown
BUY / SELL count
Reversal / Trend count
TP1 / TP2 / TP3 hits
SL hits
Current EMA and pivot settings
⚠️ Important
This indicator is intended as a technical analysis and decision-support tool, not a guarantee of profitable trading. Backtest results can vary significantly depending on the symbol, timeframe, spread, commission, slippage and execution conditions.
Suggested starting configuration:
EMA: 20 / 50 / 100
Pivot: 10 / 10
Markets: XAUUSD / BTCUSD
Timeframes: 1M / 5M
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.