Flip Gold v1.05
Expert Advisor for MetaTrader 5– Gold (XAUUSD)
Overview
Flip Gold places Buy Stop and Sell Stop pending orders at the high/low (wick) of the last closed candle on the chart timeframe. When one side is triggered, the opposite side is disabled (one-sided lock). If price moves against the position, the EA adds averaging grid layers and manages them together as one basket with a common profit target, stop and trailing.
Key Features
• Wick breakout entry: Buy/Sell Stop at the last candle's High/Low plus an offset; refreshed once per new bar; orders expire after 2 bars.
• Averaging grid: Fixed pip step between layers; lot size grows by a multiplier every few layers, with a per-position lot cap and a maximum layer count.
• ATR volatility scaling: Grid distance and basket targets adapt to market volatility (frozen per basket).
• Basket management: Basket TP in USD, trailing stop, break-even lock and optional basket stop loss.
• Risk protection: Spread limit, drawdown limit (stops adding layers), hard-close level, margin check, and DD throttle that reduces lot size after losses.
• Filters: Optional EMA trend filter, candle-size filter and local-time session filter.
• Robust operation: Works on hedging and netting accounts (auto-detected); basket state survives a terminal restart; on-chart dashboard (minimizable).
Main Default Settings
| Parameter | Default |
| Start lot / lot multiplier | 0.10 / ×1.16 every 3 layers |
| Grid step | 20 pips (ATR-scaled) |
| Stop order offset | 5 pips |
| Basket TP / trailing drop | $25 / $1.50 |
| Break-even lock | Activates at $15, locks $5 |
| Max spread | 5 pips |
| Drawdown limit / hard close | 25% / 45% of balance |
Requirements
MetaTrader 5, symbol XAUUSD (Gold), any hedging or netting account, Algo Trading enabled.
Risk warning: grid/averaging strategies can produce large floating losses. Test on a demo account and use a lot size suited to your balance.