---
id: "P:cAlgo.API.MonteCarloSettings.Iterations"
kind: "property"
type: "T:cAlgo.API.MonteCarloSettings"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/MonteCarloSettings/Iterations/"
---

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

# MonteCarloSettings.Iterations

Member of [MonteCarloSettings](https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/MonteCarloSettings/index.md).

## Iterations

Gets the number of simulated iterations. When it is 0, the default, the method default is used, which is 1000 for the resampling methods and 100 for SyntheticPricePath. Any other value outside the range of the method, which is 100 to 100000 for the resampling methods and 100 to 1000 for SyntheticPricePath, is reported as an invalid settings error instead of being clamped.

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.

C#:

```csharp
public int Iterations {get; set;}
```

Python:

```python
monteCarloSettings.Iterations: int
```

### Returns

`int` — 

Available since cAlgo.API 5.10.

### Examples

C#:

```csharp
var monteCarlo = new MonteCarloSettings(MonteCarloMethod.Bootstrap, @"C:\Temp\montecarlo-result.json") { Iterations = 5000 };
Print("Monte Carlo iterations: {0}", monteCarlo.Iterations);
```

Python:

```python
monteCarlo = MonteCarloSettings(MonteCarloMethod.Bootstrap, r"C:\Temp\montecarlo-result.json")
monteCarlo.Iterations = 5000
api.Print(f"Monte Carlo iterations: {monteCarlo.Iterations}")
```

