---
id: "T:cAlgo.API.MonteCarloMethod"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/MonteCarloMethod/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# MonteCarloMethod (enum)

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

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Available to plugins only, and plugins cannot run in the CLI.
- Cloud: Available to plugins only, and plugins cannot run in the cloud.

## Definition

```csharp
public enum MonteCarloMethod
```

Available since cAlgo.API 5.10.

## Examples

C#:

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

Print($"Monte Carlo method: {monteCarlo.Method}");
```

Python:

```python
monteCarlo = MonteCarloSettings(MonteCarloMethod.Reshuffle, r"C:\Temp\montecarlo-result.json")

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

## Values

- `MonteCarloMethod.Reshuffle` — 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.
- `MonteCarloMethod.Bootstrap` — 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.
- `MonteCarloMethod.BlockBootstrap` — 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.
- `MonteCarloMethod.StationaryBootstrap` — 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.
- `MonteCarloMethod.SyntheticPricePath` — 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.

