Trading Strategy & Input Parameters Manual
Gold (XAUUSD) & DXY Breakout EA
This Expert Advisor (EA) is designed to trade Gold (XAUUSD) by leveraging its strong inverse correlation with the US Dollar Index (DXY / USDX).
Below is a brief explanation of the core logic and a user manual for the input parameters.
1. Trading Logic Overview
Gold generally moves in the opposite direction of the US Dollar. When the US Dollar breaks out of a key support or resistance level, Gold often experiences a strong directional move.
Entry Conditions
- BUY Entry (Long):
- The US Dollar Index (DXY) closes below its lowest price over the last N bars (Breakdown below Support).
- The previous Gold candle closes as a Bullish (Green) candlestick.
Result: Enter a BUY order on Gold.
- SELL Entry (Short):
- The US Dollar Index (DXY) closes above its highest price over the last N bars (Breakout above Resistance).
- The previous Gold candle closes as a Bearish (Red) candlestick.
Result: Enter a SELL order on Gold.
Note: Entry signals are calculated only when a new candlestick opens (Bar Completion) to prevent false breakouts during live price movements.
2. Input Parameters Manual
You can customize the EA’s settings via the Inputs tab in MetaTrader 4.
| Parameter | Default Value | Description |
|---|---|---|
| InpDXYSymbol | USDX |
The symbol name of the US Dollar Index on your broker (e.g., USDX, DXY, USDOLLAR). |
| InpTimeframe | PERIOD_H1 |
Timeframe used for market analysis and entry confirmation. (Recommended: H1 or M15). |
| InpLookbackBars | 24 |
Number of past bars used to calculate Support and Resistance levels for DXY. |
| InpMinBreakPips | 1.0 |
Minimum breakout distance in pips required beyond DXY’s Support/Resistance. |
| InpEnableLog | true |
If set to true, detailed debug logs will be displayed in the Experts tab. |
| InpLots | 0.1 |
Trading lot size for each position. |
| InpStopLossPips | 25 |
Initial Stop Loss distance in pips (0 = No Stop Loss). |
| InpTakeProfitPips | 50 |
Take Profit distance in pips (0 = No Take Profit). |
| InpEnableTrailingStop | true |
Turn Trailing Stop functionality true (ON) or false (OFF). |
| InpTrailingStopPips | 20 |
Distance in pips maintained between market price and Trailing Stop Loss. |
| InpTrailingStepPips | 5 |
Step size in pips. Stop Loss updates only when price moves by this amount in profit. |
| InpSlippage | 3 |
Maximum allowed slippage in pips during order execution. |
| InpMagicNumber | 20260421 |
Unique identification number for the EA to manage its orders independently. |
3. How to Set Up On Chart
- Attach the EA to your XAUUSD chart (Recommended Timeframe: H1).
- Check your broker’s Market Watch to ensure the DXY symbol matches
InpDXYSymbol. - Make sure “Allow Live Trading” is checked in the EA settings and “AutoTrading” is enabled in MT4.













Leave a Reply