Table of Contents

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
object
CommissionRulesGroup
Extension Methods

Constructors

CommissionRulesGroup(Portfolio)

Creates an empty set of rules for an account; Init(CommissionGroup) fills it.

public CommissionRulesGroup(Portfolio portfolio)

Parameters

portfolio Portfolio

The account.

Exceptions

ArgumentNullException

portfolio is null.

Properties

Commission

The commission group the rules were created from by Init(CommissionGroup); null before it.

public CommissionGroup Commission { get; }

Property Value

CommissionGroup

Portfolio

The account the rules apply to.

public Portfolio Portfolio { get; }

Property Value

Portfolio

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

group CommissionGroup

The commission group.

Exceptions

ArgumentNullException

group is 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

trade MyTrade

The 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

order Order

The 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()