Configuring Common Trading Limits and Sessions
The Common tab within the Advanced Testing Settings allows you to set the maximum number of open orders and positions that can simultaneously exist on the account during a test. This is crucial for replicating the strict position limits that some brokers enforce on retail accounts. Additionally, you can configure specific trading sessions during which the Expert Advisor is not permitted to open or modify any positions, helping to model brokers that restrict trading during certain hours or market conditions.
By defining these boundaries, you ensure that your strategy does not rely on operating outside of standard broker constraints. The ability to block trading during custom sessions helps isolate the impact of liquidity gaps or scheduled maintenance windows that could otherwise skew test results. These settings provide a realistic framework for evaluating whether an EA can adhere to standard account limitations.
Sources: MetaTrader 5 documentation: testing
Simulating Margin Requirements and Risk Levels
The Margin tab enables the configuration of margin reserving rules and position accounting systems, allowing you to choose between OTC, Exchange, netting, or hedging models depending on your broker's classification. You can define the exact levels at which the account switches to a Margin Call state, where additional funds are required to maintain open positions, and the Stop-Out level, where all orders are canceled and positions are forcibly closed to prevent negative equity.
These thresholds can be specified either in absolute monetary terms or as a percentage of the account's Margin level, calculated as Equity divided by Margin multiplied by one hundred. Furthermore, you can control how unrealized profits or losses are factored into the free margin calculation, choosing to include only profits, only losses, or the net floating PnL. This level of granularity ensures that the capital allocation and risk management logic of the broker are accurately reflected in the test environment.
Sources: MetaTrader 5 documentation: testing
Modeling Daily Profit and Loss Blocking
Within the free margin calculation settings, you can specify how the trader's daily realized profit or loss is handled. The option to use daily fixed profit and loss includes the net PnL realized during the current trading day in the available free margin. Alternatively, you can select daily fixed loss, which includes only the losses incurred during the day, while accumulating the profits in a special blocked account field.
If the daily fixed loss option is enabled, you can further choose whether the accumulated profit is released at the end of the trading day to be added to the account balance and included in the free margin, or if it remains permanently blocked. This feature is essential for simulating brokers that implement daily drawdown limits or that hold overnight profits as collateral, significantly affecting the compounding potential of the trading account during backtests.
Sources: MetaTrader 5 documentation: testing
Configuring Multi-Level Commission Structures
The Commission tab provides extensive control over transaction costs, allowing you to model single-level or multi-level commission structures that depend on deal volume or turnover. Commissions can be charged immediately upon deal execution, or accumulated daily or monthly and debited in a single balance operation. You can set separate commission rules for entry, exit, or both types of trade directions, and choose to charge fees per individual deal or per lot volume.
The calculation currency can be set to the deposit currency, the symbol's base currency, the profit currency, the margin currency, or even in points or percentages of the deal value. For multi-level setups, you define non-overlapping ranges for volume or turnover, ensuring that as your trading activity scales, the commission rates adjust according to the broker's tiered fee schedule. This allows for precise modeling of ECN brokers that charge variable spreads and transaction fees based on market maker or STP models.
Sources: MetaTrader 5 documentation: testing
Understanding Simulation Limitations and Execution Realism
While the Advanced Testing Settings provide a robust framework for simulating broker conditions, the Strategy Tester operates within a sandboxed environment that may not perfectly replicate live execution. The tester uses historical data and emulated tick generation modes, such as Every Tick, Real Ticks, or 1 Minute OHLC, each offering a different balance between accuracy and computational speed. Network delays can be simulated using Random or Fixed delay modes to account for latency in order execution.
However, real-world factors such as slippage beyond the specified deviation, server-side requotes, and sudden liquidity drops during high-impact news events cannot be fully predicted by historical data alone. The tester does not account for the broker's internal risk management systems that might reject orders or alter leverage dynamically. Therefore, while these settings offer a highly detailed simulation, they should be used as a tool for identifying robust strategies rather than a guarantee of identical live performance.
Sources: MetaTrader 5 documentation: testing MetaTrader 5 documentation: features
AI-assisted educational article. Automated checks reviewed source support and quality; they do not guarantee accuracy. This is not investment advice. Leveraged and automated trading involves substantial risk of loss.
Sources & further reading
MetaTrader 5 documentation: testingMetaTrader 5 documentation: featuresEducational content only. This article is not investment advice. Automated and leveraged trading involves substantial risk of loss.