Table of Contents

Interface ICommissionRule

Namespace
ATAS.DataFeedsCore.Commissions
Assembly
ATAS.DataFeedsCore.dll

A commission rule of a CommissionGroup: computes the commission charged on an order or a trade of an account. CommissionRulesGroup sums the results of its rules.

public interface ICommissionRule
Extension Methods

Properties

Name

Name of the rule; it also keys the saved state of the rule in CommissionState, so it must be unique within the group and must not contain |.

string Name { get; set; }

Property Value

string

NeedSave

Whether the rule keeps a state between trades that must be saved with the account (Save(), Load(string)).

bool NeedSave { get; }

Property Value

bool

Methods

Load(string)

Restores the state saved by Save(). Called only when a saved state exists for Name.

void Load(string value)

Parameters

value string

The saved state.

Process(MyTrade)

Returns the commission charged on a trade of the account; 0 for none. The ATAS trading server subtracts it from the balance and the closed PnL of the account.

decimal Process(MyTrade trade)

Parameters

trade MyTrade

The trade of the account.

Returns

decimal

The commission, in the account currency.

Process(Order)

Returns the commission charged on an order; 0 for none.

decimal Process(Order order)

Parameters

order Order

The order.

Returns

decimal

The commission, in the account currency.

Save()

Returns the state of the rule to save with the account; called only when NeedSave is true. The state must not contain line breaks or |.

string Save()

Returns

string

The state of the rule.