OPEN-SOURCE SCRIPT
Gold 15m: Trend + S/R + Liquidity Sweep (RR 1:2)

This strategy is designed for short-term trading on XAUUSD (Gold) using the 15-minute timeframe. It combines trend direction, support/resistance pivots, liquidity sweep detection, and momentum confirmation to identify high-probability reversal setups in line with the dominant market trend.
⚙️ Core Logic:
Trend Filter (EMA 200):
The strategy only takes long positions when price is above the 200 EMA and short positions when price is below it.
Support/Resistance via Pivots:
Dynamic swing highs and lows are identified using pivot points. These act as local supply and demand levels where liquidity is likely to accumulate.
Liquidity Sweep Detection:
A bullish liquidity sweep occurs when price briefly breaks below the last pivot low (grabbing liquidity) and then closes back above it.
A bearish sweep occurs when price breaks above the last pivot high and then closes back below.
Momentum & Candle Strength:
The strategy filters signals based on candle range and body size to ensure entries occur during strong price reactions, not weak retracements.
Risk Management (1:2 RR):
Stop-loss is placed slightly beyond the last pivot level using ATR-based buffers, and take-profit is set at 2× the risk distance, maintaining a reward-to-risk ratio of 1:2.
💼 Trade Logic Summary:
Long Entry:
After a bullish liquidity sweep & reclaim, momentum confirmation, and trend alignment (above EMA 200).
Short Entry:
After a bearish sweep & reclaim, momentum confirmation, and trend alignment (below EMA 200).
Exit:
Automated via ATR-based Stop Loss and Take Profit targets.
📊 Customization Options:
Adjustable EMA length, pivot settings, ATR multipliers, and RR ratio.
Option to enable/disable trend filter.
Toggle display of S/R zones on chart.
🧠 Best Use:
Works best during London and New York sessions when Gold shows strong momentum.
Can be adapted for forex pairs and indices by tuning ATR and pivot parameters.
⚙️ Core Logic:
Trend Filter (EMA 200):
The strategy only takes long positions when price is above the 200 EMA and short positions when price is below it.
Support/Resistance via Pivots:
Dynamic swing highs and lows are identified using pivot points. These act as local supply and demand levels where liquidity is likely to accumulate.
Liquidity Sweep Detection:
A bullish liquidity sweep occurs when price briefly breaks below the last pivot low (grabbing liquidity) and then closes back above it.
A bearish sweep occurs when price breaks above the last pivot high and then closes back below.
Momentum & Candle Strength:
The strategy filters signals based on candle range and body size to ensure entries occur during strong price reactions, not weak retracements.
Risk Management (1:2 RR):
Stop-loss is placed slightly beyond the last pivot level using ATR-based buffers, and take-profit is set at 2× the risk distance, maintaining a reward-to-risk ratio of 1:2.
💼 Trade Logic Summary:
Long Entry:
After a bullish liquidity sweep & reclaim, momentum confirmation, and trend alignment (above EMA 200).
Short Entry:
After a bearish sweep & reclaim, momentum confirmation, and trend alignment (below EMA 200).
Exit:
Automated via ATR-based Stop Loss and Take Profit targets.
📊 Customization Options:
Adjustable EMA length, pivot settings, ATR multipliers, and RR ratio.
Option to enable/disable trend filter.
Toggle display of S/R zones on chart.
🧠 Best Use:
Works best during London and New York sessions when Gold shows strong momentum.
Can be adapted for forex pairs and indices by tuning ATR and pivot parameters.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
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.