Loading…

Backtest Assumption Cards

A backtest is a model, and every model simplifies something. The danger is not that the Strategy Tester simplifies reality - it has to - it is that the specific simplifications are easy to forget once a result looks good. This script is a checklist, not a measurement tool: it lists eight known, documented gaps between the tester's model and live trading, and prints the CURRENT live value next to each one where that value can actually be read (spread, swap settings, stop/freeze levels), rather than inventing a number for something it cannot know. The single sharpest card in the set is swap and commission: the tester applies the symbol's CURRENT swap settings across the entire backtest range, including years-old simulated trades, even though the broker's real historical swap rates were almost certainly different on those actual dates. A strategy that looks profitable after swap in a five-year backtest can be quietly benefiting from today's swap rate being applied retroactively to trades that, live, would have paid a different rate. Other cards cover tick generation (synthetic sub-bar movement versus genuine historical order flow), spread modelling, execution and slippage, stop/freeze level enforcement, liquidity and market impact, margin call/stop-out configuration, and calendar gaps - the one card that genuinely matches between tester and live, included so it is not mistaken for another gap. Notes and limitations - This is a checklist of KNOWN, DOCUMENTED modelling gaps, not a measurement of how large each gap is for any specific strategy - the actual impact depends on the strategy and can only be assessed with real forward testing on a demo account. - Several facts genuinely cannot be read from inside MQL4 at all (real historical requote frequency, real broker latency) - the relevant cards say so plainly instead of guessing a number. - The swap, spread, and stop/freeze values shown are a live snapshot at the moment the script runs; they will differ if run again later, since brokers change these without notice.

Script · MT4 · v1.0 · Free

About Backtest Assumption Cards

Backtest Assumption Cards is a script for MetaTrader 4. MQL source code included.

Files in the download: BacktestAssumptionCards.mq4, BacktestAssumptionCards.txt.

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria