Appearance

Personalize your experience

Mode
Accent Color
Direction
Monte Carlo and Robustness

Monte Carlo and Robustness

Backtesting

A backtest is one path through history. Monte Carlo asks how different the result could have been with the same edge: a different order of trades, a different sample of them, a different market or worse execution.

Running it

After a backtest, open the tab of the , choose a method and the number of paths, and run it. It costs one backtest credit and uses the same , and costs as the run above it. Through the API, call POST /backtest/engine/monte-carlo.

Methods

MethodWhat variesWhat it tells you
Shufflethe order of the actual how deep the and how long the losing streak could have been with exactly this profit
Bootstrapwhich occur (drawn with replacement)how much the final result depends on a few winners
Block bootstrap (market paths)the market itself: blocks of real returns stitched into new historieswhether the needs this exact history
Synthetic (market paths)a generated market with volatility regimes, jumps and GARCH clusteringbehaviour in conditions the history did not contain
Execution noise (market paths)costs, slippage, fill delay and missed how much of the edge survives worse execution

Trade methods run inside as one query over every (up to 100,000 paths), with seeded draws: the same seed gives the same result. Market-path methods re-run your on every path, so they take longer and are capped at 500 paths. They work for every language, including builder and QuaScript strategies.

Reading the results

  • Probability of loss: the share of paths that end below the starting capital. Above 30% the edge is weak relative to its noise.
  • Probability of ruin: the share of paths whose equity touches the ruin level (50% below the start by default) at any . Size positions so this stays near zero.
  • percentiles: for the 5th percentile (one in twenty is worse), not for the your single backtest happened to show.
  • bundle: up to 100 sampled equity paths with the best, worst and and the real trade order. Switch between all paths, the top 10 and the 5th–95th envelope.
  • Risk corridor: the 5th–95th and 25th–75th percentile of equity after each trade, with the ruin barrier and a pane. A wide corridor means the outcome depends on luck in trade order.
  • Terminal wealth: the of final equity across paths against a normal fit, and the risk-reward frontier: each 's against its total return.
  • Losing streaks: the share of paths by their longest run of consecutive losing . Size positions so the 95th percentile streak is survivable.
  • Actual percentile (market paths): where the real run ranks among the re-runs. Above 90, the real history was unusually kind to the .
!
Caution: cannot fix a biased backtest. from a that peeks at bars or ignores costs produces a confident of wrong numbers. Run the lookahead check and set realistic costs first.

Other robustness checks

CheckRouteQuestion it answers
Walk-forwardwalk-forwarddo parameters chosen on the past still work on the next ?
/ PBOoverfittingafter trying N parameter sets, is the best still significant?
Lookahead probelookaheaddoes the read bars it could not have seen?
comparehow correlated are two strategies’ returns (diversification)?

See also

Related articles

  • Python: Research Toolkit

    Backtesting / SDKs / Python

    Everything after the first backtest: tearsheet analytics, multi-asset portfolios, position sizing, optimization and walk-forward, overfitting tests, Monte…

  • The Backtesting Page

    Backtesting / Backtesting Page

    Automation → Backtesting runs any saved strategy or strategy file on the backtest engine, then lets you analyse, stress, optimize, validate, compare and…

  • Backtesting in Python and C++

    Backtesting / SDKs

    The quatick Python package and the header-only C++ library let you import indicators, backtest on your own machine and send the same file to Quatick.…

  • Backtesting Methodology

    Backtesting / Methodology

    What a backtest is actually evidence of, the assumptions built into it, how much data is enough, and the procedure that makes a result worth acting on.

  • C++ SDK Reference

    Backtesting / SDKs / C++

    Header-only C++20 (packages/quatick-backtest-cpp): the position simulator, an event-driven engine with the same order rules as Python, analytics, a parallel…

  • Execution Modelling

    Backtesting / Execution Modelling

    Commission, slippage, spread and fill assumptions — the difference between a backtest that means something and one that flatters. Costs are where most…

  • From Backtest to Live

    Backtesting / Going Live

    The staged path from a validated backtest to full size, what each stage can detect that the previous one cannot, and the monitoring that tells you when to stop.

  • Orders and Fills

    Backtesting / SDKs / Orders and Fills

    The event-driven engines of the Python and C++ SDKs share one set of order types and fill rules, so the same strategy fills identically in both languages…

  • Overfitting & Validation

    Backtesting / Validation

    Why searching for a good backtest reliably produces one even when no edge exists, how to recognise a fitted strategy, and the validation designs that…

Browse all knowledge base articles →