Skip to content

MonteCarloMethod

enum cAlgo.API Since 5.10

DesktopCLICloud

Specifies the Monte Carlo simulation method that is applied to a completed backtest.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public enum MonteCarloMethod

Namespace: cAlgo.API · Group: Backtesting

Examples

var monteCarlo = new MonteCarloSettings(MonteCarloMethod.Reshuffle, @"C:\Temp\montecarlo-result.json");

Print($"Monte Carlo method: {monteCarlo.Method}");
monteCarlo = MonteCarloSettings(MonteCarloMethod.Reshuffle, r"C:\Temp\montecarlo-result.json")

api.Print(f"Monte Carlo method: {monteCarlo.Method}")

Values

Name Value Description
Reshuffle 0 Randomly reorders the backtest trades. The total net profit stays the same, but the equity path, the drawdowns and the risk of ruin change, showing how much the result depended on the order the trades happened in.
Bootstrap 1 Draws trades at random with replacement, so some trades repeat and others are left out. The total profit varies between iterations, estimating how sensitive the result is to the specific trades that occurred.
BlockBootstrap 2 Resamples fixed size blocks of consecutive trades, preserving the short winning and losing streaks that a plain bootstrap would break apart. The block length is taken from the BlockSize property.
StationaryBootstrap 3 Resamples random length blocks of consecutive trades, preserving streaks while avoiding the artificial cut points that fixed size blocks introduce. The BlockSize property is used as the mean block length.
SyntheticPricePath 4 Reshuffles the historical price returns and re-runs the full backtest on each synthetic price path. The strategy reacts to the new prices, so the trades, the profit and the drawdowns all differ. This method is slower than the resampling ones and can take several minutes.

See also