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

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

# MonteCarloSettings.BlockSize

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

## BlockSize

Gets the number of consecutive trades that are kept together when resampling. It is used only by the BlockBootstrap and StationaryBootstrap methods and is ignored by the others. It must be greater than or equal to 1 and the default value is 5.

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 BlockSize {get; set;}
```

Python:

```python
monteCarloSettings.BlockSize: int
```

### Returns

`int` — 

Available since cAlgo.API 5.10.

### Examples

C#:

```csharp
var monteCarlo = new MonteCarloSettings(MonteCarloMethod.BlockBootstrap, @"C:\Temp\montecarlo-result.json") { BlockSize = 10 };
Print("Monte Carlo block size: {0}", monteCarlo.BlockSize);
```

Python:

```python
monteCarlo = MonteCarloSettings(MonteCarloMethod.BlockBootstrap, r"C:\Temp\montecarlo-result.json")
monteCarlo.BlockSize = 10
api.Print(f"Monte Carlo block size: {monteCarlo.BlockSize}")
```

