Class CommissionRulesGroup
- Namespace
- ATAS.DataFeedsCore.Commissions
- Assembly
- ATAS.DataFeedsCore.dll
The commission rules of one account, created from its CommissionGroup by the ATAS trading server, which charges them on the trades of the account. Exposed as CommissionRulesGroup.
public class CommissionRulesGroup
- Inheritance
-
objectCommissionRulesGroup
- Extension Methods
Constructors
CommissionRulesGroup(Portfolio)
Creates an empty set of rules for an account; Init(CommissionGroup) fills it.
public CommissionRulesGroup(Portfolio portfolio)
Parameters
portfolioPortfolioThe account.
Exceptions
- ArgumentNullException
portfoliois null.
Properties
Commission
The commission group the rules were created from by Init(CommissionGroup); null before it.
public CommissionGroup Commission { get; }
Property Value
Portfolio
The account the rules apply to.
public Portfolio Portfolio { get; }
Property Value
Methods
Init(CommissionGroup)
Replaces the rules with the rules of a commission group: each CommissionGroupItem is deserialized and gets its saved state from CommissionState. A rule whose type is not found or that fails to load is logged and skipped.
public void Init(CommissionGroup group)
Parameters
groupCommissionGroupThe commission group.
Exceptions
- ArgumentNullException
groupis null.
Process(MyTrade)
Returns the sum of the commissions of all rules on a trade of the account; 0 when there are no rules.
public decimal Process(MyTrade trade)
Parameters
tradeMyTradeThe trade of the account.
Returns
- decimal
The commission, in the account currency.
Process(Order)
Returns the sum of the commissions of all rules on an order; 0 when there are no rules.
public decimal Process(Order order)
Parameters
orderOrderThe order.
Returns
- decimal
The commission, in the account currency.
SaveState()
Writes the state of the rules with NeedSave to CommissionState,
one Name|state line per rule. Does nothing when no rule needs saving.
public void SaveState()