AI Swing Gold Gen2
- Experts
- 버전: 1.3
- 활성화: 5
AI Swing Gold Gen2 is a fully automated swing-trading Expert Advisor for Gold (XAUUSD) on the H4 timeframe. It reads the market once per closed H4 bar, passes 25 price-action and indicator features to an embedded ONNX machine-learning model (XGBoost classifier), and opens a trade only when the model signals BUY or SELL. Every trade is protected by an ATR-based stop loss and take profit, and a trailing stop locks in profit as price moves in your favour.
No DLLs, no external files, no web requests, no martingale. The model is compiled into the EA, so it runs offline.
How it works
- Signal — at the close of each H4 bar the model classifies the next 24 bars (≈ 4 days) as Buy, Sell or Hold, using candle structure, EMA 20/50/100/200 relationships and slope, ATR, volatility ratio, RSI, Stochastic and Williams %R.
- Entry — one new position at most per bar. Optional additional positions (up to Max open positions) are allowed only when price is at least N × ATR away from the existing ones.
- Risk — every order has a stop loss and a take profit sized from the current ATR, so risk adapts to gold's volatility.
- Exit — take profit, stop loss, trailing stop, or an opposite model signal. Optional "close before weekend".
- Dashboard — a compact panel on the chart shows the active model, current signal, time to the next H4 bar, lot size, open positions, floating P/L, spread and equity. It can be collapsed with one click, or turned off completely.
Key features
- Three bundled model variants (signal sensitivity) selectable from the inputs
- ATR-based stop loss, take profit and trailing stop
- Fixed lot or automatic lot scaling with account balance
- Maximum spread filter
- Maximum open positions and minimum distance between positions
- Optional weekend close
- Professional collapsible on-chart dashboard
Requirements
- Symbol: XAUUSD (gold). Broker suffixes (e.g. XAUUSDm , XAUUSD.r ) are supported.
- Timeframe: H4 (attach the EA to an H4 chart)
- Platform: MetaTrader 5, a recent build with ONNX support (build 3600 or newer)
- Allow algorithmic trading. No DLL imports needed.
- Hedging account recommended.
- Always test on a demo account first and verify your broker's gold specifications (digits, contract size, stop levels).
Input parameters
| Group | Input | Description |
|---|---|---|
| Money Management | Magic number | Identifier for the EA's orders |
| Lot size | Fixed lot, or base lot when Auto lot is on | |
| Auto lot | Scale lot size with account balance | |
| Balance per base lot | Auto lot: lots = balance / this value × Lot size | |
| Allow multiple positions | Allow more than one open position | |
| Max open positions | Maximum simultaneous positions | |
| Min distance between positions (x ATR) | Required ATR distance before adding a position | |
| AI Model | AI model | Bundled model variant (threshold 0.005 / 0.006 / 0.010) |
| Risk Management | Stop loss (x ATR) | Stop-loss distance in ATR multiples |
| Take profit (x ATR) | Take-profit distance in ATR multiples | |
| Max spread in pips | Skip entries above this spread (0 = disabled) | |
| Close all positions before weekend | Flatten before the Friday close | |
| Trailing Stop | Enable trailing stop | Turn the trailing stop on/off |
| Trailing trigger (x ATR profit) | Profit (in ATR) needed to start trailing | |
| Trailing distance (x ATR) | Distance kept behind price | |
| Display | Show dashboard panel | Show or hide the dashboard |
| Dashboard accent color / font size | Appearance | |
| Order comment prefix | Text added to order comments |
