Discussing the article: "Property-Based Testing for Trading Rules in MQL5 (Part 1): Generate Market Scenarios, Test Invariants, Find Edge Cases"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Property-Based Testing for Trading Rules in MQL5 (Part 1): Generate Market Scenarios, Test Invariants, Find Edge Cases.
A risk-based volume function can pass three examples and still increase a request at a rounding boundary. A trader who has checked a small account, a familiar currency pair, and a normal stop distance has evidence for those inputs. Fractional steps, minimum-volume transitions, unusual tick values, and large caps remain separate questions. A profitable backtest does not systematically exercise those arithmetic boundaries.
This article builds a deterministic MQL5 test harness for a simplified pre-cost sizing rule. Eight properties check generated scenarios, while fixed tests cover known boundaries and invalid inputs. Deliberately wrong outputs test whether the checker catches the errors it is meant to detect.
A separate demonstration finds, replays, and shrinks an intentional nearest-step rounding defect. The scripts place no orders and require no broker connection. When a check fails, we investigate the test machinery as well as the sizing rule; the failure alone does not identify which component is wrong.
Author: Sahil Bagdi