Liquidity Rotation Gold
- Experts
- Version: 1.10
- Activations: 10
Gold (XAUUSD) Expert Advisor with three engines: session liquidity sweep reversals, market structure breaks and daily range breakouts. It trades long and short. No grid, no martingale, every position has its own stop.
How it trades
1. Liquidity engine
The engine marks the high and the low of the previous trading session. When price moves beyond one of these levels, it waits for a confirmed change in market structure and then trades the reversal. Each level is traded at most once. The stop loss is placed beyond the move; the take profit is a fixed multiple of the stop distance.
2. Structure engine
The engine follows confirmed breaks of market structure in the direction of the higher-timeframe trend. The stop loss is placed at the structure level; the take profit is a fixed multiple of the stop distance.
3. Trend engine
The engine trades breakouts of multi-week price ranges on the daily chart and exits on a trailing channel.
The engines never hold opposite positions at the same time. When one engine already holds a position in the same direction, the risk of the new trade is normally reduced. Positions can stay open overnight and over the weekend. There is no news filter.
Results in the Strategy Tester (simulated, not real trading)
Standard profile, start 100,000 USD, profits reinvested, swap included. Data from the MetaQuotes demo server: real ticks for 2019-2026, 1-minute OHLC for 2010-2018 (real tick history is not available for those years). The tester charged no commission; the values with commission subtract 10 USD per lot traded.
- 2019-2026: net profit +1,004% (about +950% with commission), maximum equity drawdown 8.6%, profit factor 1.69, 2,018 trades
- 2010-2018: net profit +57% (about +37% with commission), maximum equity drawdown 29.7%, profit factor 1.10, 2,079 trades
- For comparison, the gold price changed +234% (2019-2026) and +17% (2010-2018)
- Long and short trades were both profitable in both periods (2010-2018: long +29,276 USD, short +27,973 USD)
- 42% of the trades win; the average win is 2.3 times the average loss; the longest losing streak was 18 trades
- The years 2014, 2015 and 2017 were losing years. The screenshots show every year.
How it was developed
Changes to the liquidity engine were designed on 2010-2014 and 2019-2022 and kept only if they also held on 2015-2018 and 2023-2026, which were not used for the design. Monte Carlo simulations and random comparison tests were also used. About 950 proposed rule changes were rejected because they did not hold up on the unseen years.
Risk profiles
One input sets the risk: Low (half), Standard, High (one and a half times), Very high (two times), Extreme (three times). Maximum equity drawdown in the tester, 2010-2018 / 2019-2026: Low 15.8% / 5.9%, Standard 29.7% / 8.6%, High 31.0% / 12.2%, Very high 38.8% / 14.9%, Extreme 49.4% / 18.8%. Higher profiles can lose a large part of the account. Choose a profile you are comfortable with.
Base risk per trade on Standard: between 0.1% and 1.2% of the balance, depending on the engine and the session.
Account protection (Standard; the limits widen with the higher profiles, see the screenshots)
- Daily stop: when equity falls 3.5% below the start of the day, all positions are closed and trading stops until the next day. The engines stop opening new trades earlier in a losing day.
- Account floor: when equity falls 9.5% below the starting balance, all positions are closed and trading stops until the protection state is reset.
- Loss cap per trade: 1.75% of the starting balance.
- No new trade when the terminal is disconnected or the last price is old.
- Accounts below 10,000 USD: when the lot calculated from the risk is smaller than the broker minimum, the minimum lot is used only if it risks no more than 1% of the balance; otherwise the trade is skipped. Small accounts therefore skip some trades, and their results differ from the tables above. Recommended for the Standard profile: 10,000 USD or more.
Requirements
- Symbol: XAUUSD (other names such as GOLD or XAUUSD.m also work), timeframe M15. Attach the Expert Advisor to one chart only.
- Account type: hedging (netting accounts are not supported)
- A broker with low spreads and a virtual private server (VPS) are recommended, because the Expert Advisor works 24 hours a day, 5 days a week.
- Optional filters: the liquidity engine skips some trades when most US dollar pairs (EURUSD, GBPUSD, AUDUSD, NZDUSD, USDJPY, USDCHF, USDCAD) or the S&P 500 index move strongly against the trade at the same time. Keep these symbols in Market Watch. If a symbol does not exist at your broker, that filter is switched off and the Expert Advisor still trades.
- Not available on FundingPips accounts.
Inputs
- Risk profile: Low, Standard (default), High, Very high, Extreme
- Reset the protection state: set to true once after the account floor was hit, then set it back to false
- Broker server time offset from GMT in winter: 2 for many brokers
- Broker summer time: 1 = United States dates, 0 = European dates. Example: a server at GMT+2 in winter and GMT+3 in summer that changes with the United States clock uses 2 and 1. If the setting does not match the server clock, the Expert Advisor shows a warning.
- Currency symbol suffix: for example .m if your broker names the pairs EURUSD.m
- S&P 500 index symbol: for example US500, SPX500 or US500.cash
Testing the demo
Use XAUUSD, M15, "Every tick based on real ticks" and a deposit of 10,000 USD or more. The first run can take longer while the terminal downloads the history of the filter symbols.
Support and updates
Questions are answered in the comments of this page and in private messages on MQL5. Updates are published here with a list of changes.
Days without trades are normal. The Expert Advisor trades only when its conditions are met.
Risk warning
Trading leveraged products carries a high risk of loss. Backtests and past results, simulated or real, do not guarantee future results. Use only money you can afford to lose.
