Skip to content

OptimizationSettings.ApplyCommissionAutomatically

property · OptimizationSettings · cAlgo.API Since 5.10

DesktopCLICloud

Gets a value that indicates whether the commission type and value of the optimized symbol are applied automatically. When it is set to true the Commission and CommissionType properties are ignored. The default value is false.

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 bool ApplyCommissionAutomatically {get; set;}
optimizationSettings.ApplyCommissionAutomatically: bool

Returns bool

Examples

var criteria = new[] { new OptimizationCriterion(OptimizationCriterionType.NetProfit, OptimizationCriterionDirection.Maximize) };
var settings = new OptimizationSettings(new DateTime(2025, 1, 1), new DateTime(2025, 3, 1), 10000, criteria) { ApplyCommissionAutomatically = true };
Print("Use symbol commission: {0}", settings.ApplyCommissionAutomatically);
from System import DateTime
criteria = [OptimizationCriterion(OptimizationCriterionType.NetProfit, OptimizationCriterionDirection.Maximize)]
settings = OptimizationSettings(DateTime(2025, 1, 1), DateTime(2025, 3, 1), 10000, criteria)
settings.ApplyCommissionAutomatically = True
api.Print(f"Use symbol commission: {settings.ApplyCommissionAutomatically}")