ExpertCodeFX documentation · MetaTrader 5
Lock30x XAU M5 MT5 User Manual
Install the EA, understand what each engine can trade, check the risk settings and run a test you can repeat.
1. Install and configure
- Install through MQL5 Market. In desktop MT5, sign in to the MQL5.community account that owns the licence. Find Lock30x XAUUSD (171804) in Market and install it from Purchased in the Navigator. To try the free Market demo, choose the demo on the listing and open it in Strategy Tester. The free Market demo runs in the Tester only; using an EA on a demo-account chart requires a licence that allows chart use.
- Find the tradable Gold symbol. In Market Watch, check the symbol’s Specification. It may be called XAUUSD, XAUUSD.a or GOLD; confirm it is Gold quoted in USD. Record contract size, tick size and value, minimum lot, lot step, trading hours and the broker server clock. Open its M5 chart on a demo account for the first chart setup.
- Attach one instance. Drag the EA from Navigator to the Gold chart. In Inputs, start by inspecting the built-in values. The supplied H1 signal timeframe belongs to the Core; keep the chart at M5. A separate preset is optional. Older MT5
.setfiles can override current defaults; cTrader.cbotsetfiles do not apply. - Confirm version and permissions. Look for v2.914 in the EA panel or main startup message in Experts. When you are ready for a demo forward test, enable Allow Algo Trading for the EA and turn on the terminal’s Algo Trading switch. Check that the broker account permits EA trading. Verify the chart profile, chart timeframe and Core timeframe on the panel.
2. The four engines
Each engine has its own entry, sizing and exit settings. They share the account’s equity, margin and Gold exposure. An enabled engine may wait for hours or sessions without an order if its conditions are unmet.
A · Range
Looks for breakouts around recent highs, lows and ranges. Pending orders have configurable entry distances, expiry, stops and trailing rules. Buys and sells are enabled. Trade Frequency starts in Auto, which chooses setups using balance and the Range drawdown input. In v2.914, leave Strategy 9 off if you switch to Manual Selection and avoid the Extreme preset, which selects that unavailable strategy.
The Range US nonfarm payrolls (NFP) filter is on by default. Around the scheduled release it can pause Range entries, cancel its pending orders and attempt to close its positions. The built-in release schedule is estimated; where needed, verify the time and enter the exact broker timestamp. This filter covers Range only.
B · Sessions
The session range breakout and timed buy setup are enabled. The timed setup has its own holding period and exit rules. The optional daily breakout with momentum is off. Sessions starts with automatic risk sizing based on balance and also offers manual risk percentage and fixed lots. Check its time windows, spread limit settings and any equity controls separately.
C · Portfolio
Combines selected AurumTwelve12 setups, Sovereign and its own Trend Complement. AurumTwelve12 has limits for order expiry, time between trades, same-direction positions and daily trades. Sovereign uses previous H1 highs and lows with volatility-based stops and targets. The Portfolio Trend Complement has separate spread, size and exposure controls.
D · Core
The original Core uses completed candles and places pending orders if its range, direction and timing rules allow. The supplied Core is buy-enabled and sell-disabled. The separate Hybrid Profit Boost starts enabled for buys and checks the day’s realised results, exposure and candle conditions before considering an order. The Core Trend Complement has separate buy and sell rules; the additional H1 Expansion starts disabled. Changing Core’s direction alone does not change every Engine D setup.
The shared H1 direction filter is on for selected setups: the timed Sessions setup, Sovereign strategies 2–4, and Core and Boost. Each setup still has to meet its own direction and timing rules.
3. Main inputs and defaults
These are the v2.914 factory values. If you have loaded a preset, check the values actually shown in MT5. This table covers the settings to review first; use the named engine groups in Inputs for individual strategy settings.
| Input | Default | What to check |
|---|---|---|
ComboCoreSignalTimeframe | H1 | Core signal bars. The Gold chart remains M5. |
ComboEnableWarden, ComboEnablePropGold, ComboEnableObsidian, ComboEnableLock30xV288 | On | Internal names for the four engine switches: A · Range, B · Sessions, C · Portfolio and D · Core, respectively. |
AutoAccountCapitalSizing | On | Scales applicable Gold reference amounts using a saved starting-capital baseline. Engine sizing rules still apply. Leave AutoSizingProfileId at 0 unless intentionally selecting a new baseline. |
PortfolioSizeMultiplier | 0.5 | Applies to the size of new orders across the engines. This is a volume multiplier, not a percentage risk limit. Final size also depends on the engine, broker lot step and minimum, and available margin. |
EnableDrawdownProtection | Off | Master switch for the loss controls that depend on it. Individual trade stops and broker execution checks can still apply. |
PortfolioBreakerEnabled / PortfolioDrawdownTrigger | On / 20% | The shared equity breaker requires the master switch above. When triggered, it pauses entries and attempts to cancel pending orders and close positions owned by the EA on that symbol. Its peak and halt state can persist across restarts in the same terminal. |
AdaptiveExposureEnabled / LaneRiskSizingEnabled | Off / Off | Optional reductions to new order volume. The lane option targets the timed Sessions setup and the original Core. Test changes before relying on them. |
RegimeFilterEnabled | On | Applies an H1 direction check to selected strategies. It is separate from each strategy’s buy/sell permissions. |
MT5BrokerClockMode | UTC+2/+3 with US daylight saving | Maps the broker clock to the strategy reference clock. Confirm the broker’s historical offset and daylight-saving schedule. Do not enter your computer’s local time zone here. |
Check actual order volume, initial stop distance, aggregate exposure and margin in your test. The same input values can produce different orders on a broker with a different contract size, spread or minimum lot. If a sizing calculation is below the broker minimum, the EA can skip that entry.
Start with the default order identifiers (also called magic numbers). Keep PG_InpCloseAllAccountPositions off; the combined EA rejects that setting if enabled. Risk controls cannot guarantee a maximum loss. Gaps, slippage, spread changes and unavailable liquidity can affect fills and exits.
4. Hedging and netting
Hedging: MT5 can hold multiple separate positions on the same symbol. Lock30x can manage positions under its own order identifiers, subject to its engine settings and broker limits.
Netting: MT5 keeps one combined position per symbol. Lock30x also waits before making a new entry if that symbol already has a position, a pending order or an unresolved entry request. If your live or demo chart shows several orders but your backtest shows one at a time, compare the account modes first. Keep the EA’s symbol separate from manual trades and other EAs on netting accounts, where their trades can affect the combined position.
Other symbols: The EA selects its profile from the chart symbol. On non-USD-Gold symbols, including EURUSD, only Sessions is eligible. Its stop calculation starts with 2 × the 14-period ATR on completed H1 candles and can be adjusted for spread and broker limits. Treat that as a different test from the four-engine Gold profile.
5. Backtest and demo
- Open Strategy Tester in MT5 and choose the installed v2.914 EA, your broker’s Gold symbol, M5 and a defined date range. Match the intended account’s currency, starting deposit, leverage and hedging or netting mode. Check the simulated account settings where your Tester build exposes them.
- Use a single test with fixed inputs before optimising. Select Every tick based on real ticks where your broker supplies enough data. Record the tick mode, alternative data if used, and assumptions for spread, commission, swap and execution delay.
- Save the effective
.set, completed report and Tester Journal. Review order rejections, losing trades, equity drawdown, costs, trade count and concurrent exposure. To isolate a difference, change one setting or engine group at a time and keep a separate date range for a repeat check. - With a licence that permits chart use, run a demo forward test on your intended broker configuration. Observe orders, fills, session timing and exits, and record differences from the Tester. A backtest and a broker demo answer different questions; neither establishes future or live returns.
Follow the illustrated first-backtest tutorial · Keep a demo test journal · MetaTrader 5 Strategy Tester help.
6. Monitor, pause and update
The panel shows current balance, equity, floating P/L, spread, open positions, pending orders and results grouped by engine from available history. Check the selected profile, timeframes and the status of the sizing, direction filter and drawdown controls. The panel’s observed drawdown starts from attachment or the visual test start; it is different from the shared equity breaker’s persisted peak.
Pausing the EA does not flatten the account. Before disabling Algo Trading, removing the EA, changing engines, restarting MT5 or moving to another terminal, check open positions, pending orders and the broker-side stops and targets. An EA that cannot trade cannot manage exits or cancel pending orders. Check exposure directly in MT5 and make a plan for any orders or positions left open.
Before updating through MQL5 Market, save your current settings and inspect exposure. Avoid having the old and new versions run together on the same account and symbol, including on a VPS. After the update, verify the new build and actual inputs, check any orders or positions already on the account, and repeat a controlled test before reusing a preset.
What v2.914 changed: If an existing stop loss or take profit sits inside the broker’s freeze distance, the EA can defer a market close and leave that protection in place. If the exit is still due at the next normal opportunity, it checks again. This does not guarantee immediate closure; verify the position and read the relevant log if it remains open.
7. Troubleshoot and get support
| What you see | What to check |
|---|---|
| Waiting for signal or no trades | Check the symbol and profile, enabled engines and directions, session mapping, spread, filters and sufficient quote history. In a test, inspect the Tester Journal before changing inputs. |
| Trading disabled | Check the MT5 connection, terminal Algo Trading switch, EA chart permission, broker account permissions and market hours. |
| Netting: waiting for symbol | Check for a position or pending order on the same symbol, including orders from other sources. Confirm the Tester account mode if you are comparing runs. |
| Entry sizing: quote wait, or order not accepted | Check quotes, account-currency conversion, volume limits, margin and the broker’s stop distance. Capture the exact message from Experts or Journal. |
| Equity breaker halted | Inspect the account equity, relevant inputs and remaining orders or positions. A restart alone may not clear the halt. Review the trigger before changing any settings. |
| Initialisation failed after changing a Range preset | Return to Auto or verify that Strategy 9 is off in Manual Selection. The Extreme preset selects an unavailable setup in v2.914. |
Still stuck? Use MQL5 product support or email ExpertCodeFX support with the EA version, broker and exact symbol, chart timeframe, account mode, relevant inputs, and the exact message and time from Experts, Journal or the Tester Journal. Remove credentials and account identifiers. For a test with no orders, see the MT5 Strategy Tester troubleshooting guide.