---
id: "M:cAlgo.API.MonteCarloSettings.#ctor(cAlgo.API.MonteCarloMethod,System.String)"
kind: "constructor"
type: "T:cAlgo.API.MonteCarloSettings"
url: "https://help.ctrader.com/ctrader-algo/references/Plugin/Backtesting/MonteCarloSettings/Constructor/"
---

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

# MonteCarloSettings constructor

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

## MonteCarloSettings(MonteCarloMethod method, string outputFilePath)

Initializes a new instance of the MonteCarloSettings record. The method and the output file path are required, every other setting is optional.

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 MonteCarloSettings(MonteCarloMethod method, string outputFilePath)
```

Python:

```python
MonteCarloSettings(method: MonteCarloMethod, outputFilePath: str)
```

### Parameters

- `method` (`MonteCarloMethod`, Python `MonteCarloMethod`): The Monte Carlo simulation method.
- `outputFilePath` (`string`, Python `str`): The destination file path for the Monte Carlo result JSON.

Available since cAlgo.API 5.10.

### Examples

C#:

```csharp
var monteCarlo = new MonteCarloSettings(MonteCarloMethod.Bootstrap, @"C:\Temp\montecarlo-result.json")
{
    Iterations = 2000,
    Seed = 7
};
var settings = new BacktestingSettings { Balance = 10000, MonteCarlo = monteCarlo };
```

Python:

```python
monteCarlo = MonteCarloSettings(MonteCarloMethod.Bootstrap, r"C:\Temp\montecarlo-result.json")
monteCarlo.Iterations = 2000
monteCarlo.Seed = 7
settings = BacktestingSettings()
settings.Balance = 10000
settings.MonteCarlo = monteCarlo
```

## MonteCarloSettings(MonteCarloSettings original)



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 MonteCarloSettings(MonteCarloSettings original)
```

Python:

```python
MonteCarloSettings(original: MonteCarloSettings)
```

### Parameters

- `original` (`MonteCarloSettings`, Python `MonteCarloSettings`):

Available since cAlgo.API 5.10.

