Click or drag to resize

Commission

The CommissionManager manager is used to calculate commissions in the trading algorithm.

The tariff plan is created by adding the relevant CommissionRule rules, based on which commissions will be calculated further.

The CommissionManager creating

  1. To create the CommissionManager:

    C#
    private CommissionManager _commissionManager = new CommissionManager();
  2. Then, you must create the rule:

    C#
    CommissionRule commissionRule = new CommissionRule {Type = CommissionTypes.PerTradeVolume, Value = new Unit(1m)};
  3. And add it to the CommissionManager:

    C#
    _commissionManager.Rules.Add(commissionRule);;

The commission can be calculated both by the trades and by orders. To calculate the commission by the trade the Process method is called, in which as a parameter the Message is passed (ExecutionMessage or OrderRegistryMessage).

The total value of the commission can be found through the Commission.