BacktestingSettings
class cAlgo.API
DesktopCLICloud
Represents settings for configuring the backtesting process.
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 class BacktestingSettings
Namespace: cAlgo.API · Group: Backtesting
Examples
var settings = new BacktestingSettings
{
StartTimeUtc = new DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc),
EndTimeUtc = new DateTime(2025, 6, 1, 0, 0, 0, DateTimeKind.Utc),
Balance = 10000,
DataMode = BacktestingDataMode.M1,
SpreadPips = 0.5,
ApplyCommissionAutomatically = true
};
if (AlgoRegistry.Get("Sample Trend cBot", AlgoKind.Robot) is RobotType robotType)
Backtesting.Start(robotType, "EURUSD", TimeFrame.Hour, settings);
from System import DateTime, DateTimeKind
settings = BacktestingSettings()
settings.StartTimeUtc = DateTime(2025, 1, 1, 0, 0, 0, DateTimeKind.Utc)
settings.EndTimeUtc = DateTime(2025, 6, 1, 0, 0, 0, DateTimeKind.Utc)
settings.Balance = 10000
settings.DataMode = BacktestingDataMode.M1
settings.SpreadPips = 0.5
settings.ApplyCommissionAutomatically = True
algoType = api.AlgoRegistry.Get("Sample Trend cBot", AlgoKind.Robot)
if algoType is not None:
api.Backtesting.Start(RobotType(algoType), "EURUSD", TimeFrame.Hour, settings)
Constructors
| Name | Description |
|---|---|
| BacktestingSettingsDesktopCLICloud | Represents settings for configuring the backtesting process. |
Properties
| Name | Description |
|---|---|
ApplyCommissionAutomaticallyDesktopCLICloudbool | Gets or sets a value that indicates whether the commission type and value of the backtested symbol are applied automatically. When it is set to true the Commission and CommissionType properties are ignored. The default value is false. |
BalanceDesktopCLIClouddouble | Gets or sets the initial balance for the backtesting. |
CommissionDesktopCLIClouddouble | Gets or sets the commission value, it is interpreted based on the CommissionType property value. It is ignored when ApplyCommissionAutomatically is set to true. The default value is 0. |
CommissionTypeDesktopCLICloudSymbolCommissionType | Gets or sets the commission type that defines how the Commission property value is interpreted. It is ignored when ApplyCommissionAutomatically is set to true. The default value is SymbolCommissionType.UsdPerMillionUsdVolume. |
DataFileDesktopCLICloudstring | Gets or sets the path to the data file used for backtesting. |
DataModeDesktopCLICloudBacktestingDataMode | Gets or sets the data mode used for backtesting. |
EndTimeUtcDesktopCLICloudDateTime | Gets or sets the end time in UTC for the backtesting period. |
MonteCarloDesktopCLICloudMonteCarloSettings | Gets or sets the optional Monte Carlo simulation that runs on the completed backtest. When it is null, the default, no Monte Carlo simulation is performed and the backtest behaves exactly as before. When it is set, the simulation runs on the completed backtest and its result is written to the configured output file. |
PreciseConversionDesktopCLICloudbool | Gets or sets a value indicating whether historical data for additional symbols is downloaded to convert profit and margin into the account deposit currency precisely. When true, real historical exchange rates of the additional symbols are used; when false, the default, approximated rates are used. Enabling it can increase the run time and the amount of downloaded data. |
SpreadPipsDesktopCLIClouddouble | Gets or sets the spread in pips. |
StartTimeUtcDesktopCLICloudDateTime | Gets or sets the start time in UTC for the backtesting period. |
Deprecated members (1)
public double CommissionUsdPerMillionUsd {get; set;}— Use Commission with CommissionType instead