XAUUSD 1-Minute Scalping Strategy - Advanced Strategy for ExitsThis is a **mean-reversion scalping strategy** optimized for **XAUUSD on the 1-minute (or the 5-minute) timeframe**. It combines a classic **RSI(14)** oscillator with an optional **200-period EMA trend filter** to identify short-term overextended conditions in gold price action, while enforcing fixed, conservative exits to maintain strict risk control.
### Core Logic & Why This Combination:
The strategy enters counter-trend when RSI reaches extreme levels (below 30 for longs, above 70 for shorts), capturing quick snap-backs that frequently occur in gold's intraday volatility.
- **RSI(14)** acts as the primary momentum filter — detecting oversold/overbought exhaustion.
- The **200 EMA trend filter** (enabled by default) adds directional context: longs are allowed only when price is above the EMA (overall uptrend bias), shorts only below it (downtrend bias). This reduces whipsaws in strong trending sessions and improves trade quality without overly restricting opportunities.
- Disabling the trend filter allows pure mean-reversion trading (useful in ranging/Asian sessions), but enabling it is strongly recommended for better expectancy in most market conditions.
Entries occur only when flat (no pyramiding), keeping the system clean and directional.
### Exit Rules (Fixed at Entry):
- **Take Profit**: +10 pips (0.10 in XAUUSD price terms)
- **Stop Loss**: -5 pips (0.05 in price terms)
- **Risk:Reward** = 1:2
Exits are **set once on the entry bar** using limit/stop orders — this prevents dynamic recalculation and mimics real broker behavior more closely. The 2:1 RR gives the strategy mathematical edge even with moderate win rates.
### Performance & Realism Guidelines:
This strategy is tuned for **high-frequency scalping** on gold, which typically produces hundreds to thousands of trades per year on 1-minute data.
Recommended **backtest/publication settings** (update these in the strategy properties before publishing):
- **Initial Capital**: $10,000 – $50,000 (realistic for retail prop/swing traders; the script defaults to $1,000,000 only for visual scaling — change it!)
- **Order Size**: Fixed 0.10–0.50 lots (adjust according to account size)
- **Commission**: 3–7 USD per round-turn lot (typical ECN/raw-spread gold commission on brokers like IC Markets, Pepperstone, etc.)
- **Slippage**: 2–5 ticks (≈0.02–0.05 in price) — gold can be slippery during news/volatility spikes on 1-minute charts
- **Pyramiding**: 1 (default — no stacking)
- **Dataset**: At minimum 1–3 years of 1-minute data (aim for >500–1000 closed trades for statistical significance)
With realistic costs applied, expect win rate ≈55–70%, profit factor >1.4–1.8 in favorable periods, but results vary significantly across trending vs. ranging regimes and news events.
**Risk per trade** remains very controlled (typically <0.5–1.5% depending on SL distance and position sizing) — never exceeds sustainable levels.
### Important Usage Notes:
- Check thoroughly the curve-fitted back tests.
- Gold is extremely volatile on 1-minute charts; check major news (NFP, FOMC, FED) unless you widen SL/TP dynamically (you can manually implement it here).
- Always forward-test on demo first and use proper position sizing.
- The built-in dashboard shows live stats (net P&L, win rate, profit factor, current RSI, position status, etc.) for quick monitoring.
- Restricted Sample Size for Precision
Happy scalping — trade responsibly! 🚀
Chiến lược Pine Script®



