Introduction
OneSet Gold is a session range breakout Expert Advisor for MetaTrader 5, built for XAUUSD (gold). It takes one breakout setup a day from a fixed session range, manages the trade, and closes everything by the end of the session.
This post explains how to install the EA, how the strategy works, what every setting does, and how to use the built-in prop firm challenge simulator. It applies to version 1.20.
The default settings are a neutral starting point. Buyers receive the recommended set file by private message after purchase or rental. Load it before you test or trade.
Installation
| Item | Requirement |
|---|---|
| Platform | MetaTrader 5, hedging or netting account |
| Symbol | XAUUSD (gold). Point settings assume a 2-decimal gold quote. |
| Timeframe | Any. The EA reads M1 data for the range. |
| Account | Enough balance that your risk % is above the broker's minimum lot |
| VPS | Recommended for live trading |
- In MetaTrader 5, open the Market tab in the Toolbox and go to Purchased.
- Click Install next to OneSet Gold. It appears under Navigator > Expert Advisors > Market.
- Open an XAUUSD chart and drag OneSet Gold onto it.
- On the Common tab, tick Allow Algo Trading.
- On the Inputs tab, click Load and choose the recommended set file, then click OK.
- Make sure the Algo Trading button on the toolbar is on.
Use one chart per copy of the EA, and give each copy its own magic number.
Quick start
- Load the set file. Use the recommended set file you received after purchase. The defaults are not the recommended settings.
- Check your server time. All session and news times are broker server time. If your broker's time zone differs from the one the set file was made for, shift every time by the difference.
- Check your risk. The default risk is 1% per trade. The recommended set file turns on loss recovery, which doubles the lot size for the day after a losing trade. Turn it off if you want a fixed risk per trade.
- Backtest. In the Strategy Tester, choose OneSet Gold, XAUUSD and "1 minute OHLC" modelling, and test at least 12 months.
- Demo trade. Run the EA on a demo account for at least two weeks before trading live.
For a prop firm challenge, set the account protection limits slightly inside your firm's rules, and test the challenge with the simulator first.
How the strategy works
The EA takes one breakout setup per day, in five stages.
- Daily reset. At the first tick of each day the EA clears yesterday's range and orders and records the day's starting balance.
- Range. During the session window it tracks the highest high and lowest low of all M1 bars. The range lines are drawn on the chart.
- Entry. When the window closes, the EA checks the day filter, news windows, range size, spread, daily trade limit and losing-streak pause. If all pass, it places a buy stop above the range and a sell stop below it. In confirmation mode it instead waits for an M1 candle to close beyond the range and enters at market.
- Management. When one order fills, the opposite order is deleted. The trade can then be managed with breakeven, trailing stop, partial close and a time exit.
- Session end. At the cancel time unfilled orders are deleted, and at the close time open trades are closed. Nothing is held overnight with the default settings.
Stop loss and take profit come from ATR, a percentage of the entry price, or fixed points, in that order of priority. Lot size is set so a stop-out loses your chosen % of the balance. Before every order the EA checks free margin, the broker's stop distance and order limits, and skips the order with a message in the Experts log if a check fails.
If re-entry is on and a trade is stopped out at a loss, the EA can re-enter once in the same direction when price breaks the range again.
Settings guide
Settings appear in the Inputs tab under these group headings. Defaults are the EA's neutral values; the recommended set file changes many of them. Points assume XAUUSD quoted to 2 decimals, where 100 points = 1.00 of price.
Session Times (broker server time)
| Setting | Default | What it does |
|---|---|---|
| Range start hour / minute | 7 / 0 | When the range window opens |
| Range end hour / minute | 8 / 0 | When the range closes and the entry is placed |
| Cancel unfilled orders: hour / minute | 20 / 0 | When unfilled orders are deleted |
| Close open trades: hour / minute | 21 / 0 | When open trades are closed. Must not be before the cancel time. |
Trading Days and EA Identity
| Setting | Default | What it does |
|---|---|---|
| Trade on Monday to Friday | Mon to Thu on, Fri off | Days the EA trades |
| Magic number | 10010001 | Identifies this EA's trades. Use a different number on each chart. |
| Order comment | OneSetGold | Comment on every order |
Filters
| Setting | Default | What it does |
|---|---|---|
| Use range size filter | false | Skip days when the range is outside the limits |
| Minimum / maximum range size | 80 / 800 points | Range sizes allowed |
| Use spread filter | false | Skip the entry when the spread is too wide |
| Maximum spread | 30 points | Largest spread allowed at entry |
| Block new orders in news windows | false | Hold entries inside five fixed daily time windows |
Breakout Confirmation
| Setting | Default | What it does |
|---|---|---|
| Wait for M1 close beyond range | false | Enter at market after a confirmed close instead of using stop orders |
| M1 closes needed to confirm | 1 | M1 candles in a row that must close beyond the range |
Risk and Lot Size
| Setting | Default | What it does |
|---|---|---|
| Risk-based lots | true | true = lot size from risk %, false = fixed lots |
| Risk per trade | 1.0% | Risk per trade as % of balance |
| Maximum risk per trade | 2.0% | Upper limit on the risk % |
| Fixed lot size | 0.01 | Lots used when risk-based lots are off |
| Maximum lot size | 5.0 | Largest lot size ever sent |
| Skip if minimum lot is too risky | false | Skip the trade when the broker's minimum lot risks more than your setting |
Loss Recovery
| Setting | Default | What it does |
|---|---|---|
| Raise lots after a losing day | false | Multiply the next day's lot size after a losing trade |
| Lot multiplier per losing day | 2.0 | Multiplier per recovery step |
| Recovery days in a row | 2 | Steps before lots return to normal |
Recovery raises the risk of the next trade by the multiplier and can increase drawdowns. Consider leaving it off on prop firm accounts.
Stop Loss and Take Profit
| Setting | Default | What it does |
|---|---|---|
| Use ATR for stop and target | false | ATR-based stop and target (H1). Overrides the settings below. |
| ATR period / TP multiple / SL multiple | 14 / 1.5 / 1.0 | ATR settings |
| Take profit | 6000 points | Fixed target (0 = none) |
| Stop loss | 3000 points | Fixed stop |
| Stop loss as % of entry price | false, 1.0% | Set the stop as a % of the entry price |
Trade Management
| Setting | Default | What it does |
|---|---|---|
| Use partial close | false | Close part of the trade at a first target |
| Partial close size / at profit | 50% / 250 points | How much to close and when |
| Use trailing stop | false | Trail the stop behind price |
| Start trailing at profit / trailing distance | 85 / 45 points | Trailing settings |
| Use breakeven | true | Move the stop to entry once in profit |
| Breakeven at profit / points locked | 1500 / 100 points | Breakeven settings |
| Close trades after a set time | false, 4 hours | Maximum trade length |
Re-entry and Entry Offsets
| Setting | Default | What it does |
|---|---|---|
| Re-enter once after a stop-out | false | One re-entry after a losing stop-out. Allowed even when the daily trade limit is reached. |
| Re-entry lot multiplier | 1.0 | Re-entry lots = normal lots x this |
| Buy / sell stop offset | 10 / 10 points | Distance beyond the range high and low for the entries |
Account Protection
| Setting | Default | What it does |
|---|---|---|
| Daily loss limit | 0 (off) | Close everything and stop for the day at this % loss |
| Max drawdown limit | 0 (off) | Close everything and stop until the EA is restarted |
| Daily profit target | 0 (off) | Close everything and stop for the day at this % profit |
| Maximum trades per day | 1 | Most new positions per day. Partial closes do not count. |
| Pause after losses in a row | 0 (off) | Skip the next session after this many losses in a row |
| Weekly loss limit | 0 (off) | Close everything and stop until next week |
| Drawdown from equity peak | false | Measure drawdown from the highest equity instead of the starting balance |
| Pause new orders now | false | Stop new entries straight away |
Alerts, Chart Lines and Dashboard
| Setting | Default | What it does |
|---|---|---|
| Alert when orders are placed / a trade opens / a trade closes | true | Pop-up alerts for each event |
| Warn near the daily loss limit | true | Warning bar at 80% of the daily loss limit |
| Send push notifications / email alerts | false | Send alerts to your phone or email |
| Draw range lines / TP and SL lines | true | Chart lines for the range and the open trade |
| Show dashboard, X / Y position | true, 15 / 30 | Main dashboard and its position |
| Dashboard refresh interval | 500 ms | Shortest time between redraws (0 = every tick) |
Prop firm challenge simulator
The simulator replays a prop firm challenge inside the Strategy Tester, so you can see how often the strategy would pass, fail or reach payouts before you buy a challenge. It uses a simulated account that starts at your chosen account size; lot sizes, targets and drawdown limits all use that simulated balance.
How a challenge runs:
- Phase 1 starts on the first day of the backtest.
- When equity reaches the target (and any minimum trading days are met), trades are closed and the phase is passed if the closed balance is still at the target.
- The EA waits until the next day, then starts Phase 2, or the Funded account for one-phase challenges, at the full starting balance.
- The Funded account has no target. It runs under its own drawdown rules and can take simulated payouts.
- If a drawdown rule is broken, the account fails. A new Phase 1 starts the next day at exactly the starting balance, or the EA stops, depending on your setting.
| Setting | Default | What it does |
|---|---|---|
| Enable prop challenge simulator | false | Turn the simulator on |
| Account size | 10000 | Simulated starting balance (0 = tester deposit) |
| Two-phase challenge | false | Phase 1, Phase 2, Funded, or Phase 1, Funded |
| Phase 1 / Phase 2 profit target | 6% / 5% | Targets as % of the starting balance |
| Minimum trading days per phase | 0 (off) | Trading days needed before a phase can pass |
| When the challenge fails | Restart Phase 1 next day | Restart or stop the EA |
| Max drawdown type | Static | Static, trailing from equity peak, trailing from balance peak, or trailing that locks at the starting balance |
| Max drawdown | 6% | % of the starting balance |
| Daily drawdown measured from | Start-of-day balance | Start-of-day balance or equity, the higher of the two, or the day's highest equity |
| Daily drawdown | 2.5% (0 = off) | Daily limit; can fail the account or only stop the day |
| Funded drawdown type / max / daily | Static / 6% / 2.5% | Separate rules for the Funded account |
| Daily profit cap | 2% (0 = off) | Close trades and stop for the day at this daily profit |
| Simulate payouts | true | Payouts on the Funded account |
| Payout frequency / payout % | Monthly / 50% | When payouts are taken and how much of the new profit |
| Minimum profit for payout | 1% | Profit below this carries over |
| Raise DD floor after 1st payout | true | Move the max drawdown fail level up to the starting balance |
At the end of each test, the Journal tab prints a summary of attempts, passes, failures, payouts and the final simulated balance. The simulator is an approximation; check your firm's current rules.
Dashboard and simulator panel
The main dashboard shows what the EA is doing: its status, spread, balance and equity, day and week profit or loss, drawdown, today's range, trades taken, losing streak, risk and lot size, daily loss limit use and recovery state.
When the simulator is on, a second panel shows:
- the stage (Phase 1, Phase 2 or Funded), attempt number and starting balance
- a status bar: active, trade open, waiting for next day, stopped for today, or failed
- simulated balance, equity and stage profit
- a progress bar to the phase target and the amount still needed
- max and daily drawdown bars with the fail level and the room left
- today's profit and the daily profit cap
- total withdrawn, payout count and the next payout date
Green means fine, orange means caution and red means a limit is close. Both panels scale with your screen's display scaling and stay on the chart when a visual backtest ends.
Backtesting tips
- Use "1 minute OHLC" modelling for fast tests and "Every tick based on real ticks" for a final check. "Open prices only" is not suitable, because the range is built from M1 bars.
- Turn visual mode off for speed. Turn it on when you want to watch the dashboard and simulator panel.
- Test at least 12 months, and look at the results year by year rather than only the total.
- The tester's balance graph shows the real tester account, not the simulated prop account. Use the simulator panel and the Journal summary for challenge results.
- Backtests do not include every real-market effect, such as slippage at news times.
Troubleshooting and FAQ
| Problem | Likely cause and fix |
|---|---|
| No orders placed | Check the dashboard status: range or spread filter, day filter, news window, daily trade limit, losing-streak pause or a protection limit. |
| "Orders skipped (see Experts log)" | The log gives the reason: not enough free margin, a broker limit, or the minimum lot being too risky. |
| Orders at the wrong time | Times are broker server time. Compare your broker's clock with your settings. |
| Lot size larger than expected | Loss recovery is active, or the broker's minimum lot was used. |
| Range filter skips most days | Your broker may quote gold with 3 decimals. Multiply all point settings by 10. |
| Panels not visible in the tester | Panels only draw in visual mode. |
| EA stopped after a loss | A protection limit was reached; the status line says which. |
Can I run it on other symbols? It runs on any symbol, but the settings are designed for gold. Other symbols need their own settings and testing.
Can I run it on several charts? Yes, with a different magic number on each chart.
Does it hold trades overnight? Not with the default settings.
Does it use grid or martingale? It never opens several trades to average a position. The optional loss recovery mode doubles the lot size for the day after a losing trade, which is a martingale-style rule. It is off by default and on in the recommended set file, and you can turn it off at any time.
Risk notice and support
Trading leveraged products such as gold CFDs carries a high risk of loss. OneSet Gold follows fixed rules and does not guarantee profit; past and backtested results do not predict future results. Test on a demo account first and only trade with money you can afford to lose.
For help, send me a private message on MQL5 or comment on the product page. Please include your broker, account type, your settings or set file, and a screenshot of the Experts and Journal tabs.


