Table of Contents

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:

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

     CommissionRule commissionRule =  new CommissionPerTradeRule {  Value = new Unit(1m) };
    
    
  3. And add it to the CommissionManager:

    _commissionManager.Rules.Add(commissionRule);;
    
    

The commission can be calculated both by the trades and by orders. To calculate the commission by the trade the CommissionManager.Process(StockSharp.Messages.Message message**)** method is called, in which as a parameter the Message - a message containing information about the order or own transaction.

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