We provide a controlled MQL5 test that sizes exposure from variance, applies a cap, and checks the implied next-bar standard deviation against a 0.75% target. Rolling-20 and EWMA-0.94 are audited against a fixed-exposure control using a generator with known next-bar variance. All sizing requests, caps, and conditional-risk deviations are recorded to CSV for detailed review.
Suppose an Expert Advisor forecasts next-bar volatility and adjusts exposure to meet a risk target. Before connecting that rule to orders, we need to check three things: whether the forecast is converted using the correct units, whether each decision uses only information available at that time, and how far the resulting conditional risk is from the target.
This article builds a repeatable MQL5 audit using synthetic returns with known next-bar variance. You will run rolling and EWMA variance estimators alongside a fixed-exposure control, then inspect a decision ledger that separates forecast-based sizing from the risk implied by the generator. The audit also tracks the effect of the exposure cap.
The test evaluates a sizing calculation under controlled conditions. It does not measure trading profitability or determine broker-ready volume: it excludes orders, fills, trading costs, and broker constraints. In real market data, the next-bar conditional variance used as the audit reference is not directly observable.
We take inspiration from FinStressTS (2026), which uses financial mechanisms to model and diagnose problems related to incorrect predictions in financial markets. The case discussed in the paper provides a basis to evaluate other approaches to model volatility outside of the constant-variance Gaussian case. We’ve developed an analogous, but smaller, single series position sizing system in MQL5. It is important to note that our code does not incorporate the paper’s benchmark or multi-asset returns generation component, and the authors of the paper do not mention our sizing estimates.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Check out the new article: Volatility Sizing Under Controlled Stress in MQL5 (Part 1): From Known Variance to Auditable Position Sizes.
Suppose an Expert Advisor forecasts next-bar volatility and adjusts exposure to meet a risk target. Before connecting that rule to orders, we need to check three things: whether the forecast is converted using the correct units, whether each decision uses only information available at that time, and how far the resulting conditional risk is from the target.
This article builds a repeatable MQL5 audit using synthetic returns with known next-bar variance. You will run rolling and EWMA variance estimators alongside a fixed-exposure control, then inspect a decision ledger that separates forecast-based sizing from the risk implied by the generator. The audit also tracks the effect of the exposure cap.
The test evaluates a sizing calculation under controlled conditions. It does not measure trading profitability or determine broker-ready volume: it excludes orders, fills, trading costs, and broker constraints. In real market data, the next-bar conditional variance used as the audit reference is not directly observable.
We take inspiration from FinStressTS (2026), which uses financial mechanisms to model and diagnose problems related to incorrect predictions in financial markets. The case discussed in the paper provides a basis to evaluate other approaches to model volatility outside of the constant-variance Gaussian case. We’ve developed an analogous, but smaller, single series position sizing system in MQL5. It is important to note that our code does not incorporate the paper’s benchmark or multi-asset returns generation component, and the authors of the paper do not mention our sizing estimates.
Author: Maxell Agustin Aguiran