CommissionRule

StockSharp.Algo.Commissions

A regra de cálculo da comissão.

Herda de: NotifiableObject

Implementa: ICommissionRule, IAsyncPersistable

Construtores

CommissionRule
protected CommissionRule()
commissionRule = CommissionRule()

Inicializar CommissionRule.

Propriedades

Min
public decimal Min { get; set; }
value = commissionRule.Min
commissionRule.Min = value

Lower bound on a charge this rule produces. Zero means no bound.

Title
public string Title { get; private set; }
value = commissionRule.Title
commissionRule.Title = value

Título.

Value
public Unit Value { get; set; }
value = commissionRule.Value
commissionRule.Value = value

O valor do parâmetro.

Métodos

EnterScope
protected Scope EnterScope()
result = commissionRule.EnterScope()

Introduza o escopo de sincronização.

Retorna: Âmbito de aplicação

GetTitle
protected virtual string GetTitle()
result = commissionRule.GetTitle()

Arranja o título.

GetValue
protected decimal? GetValue(decimal? price, decimal? volume)
result = commissionRule.GetValue(price, volume)

Obter valor de comissão usando o preço e o volume. Para por cento de unidades, usa o volume de negócios (preço * volume). As unidades absolutas retornam o valor absoluto.

price
Base de preços (ordem ou comércio).
volume
Base de volume (ordem ou comércio).

Retorna: Valor da Comissão ou nulo, se não puder ser calculado.

LoadAsync
public virtual Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = commissionRule.LoadAsync(storage, cancellationToken)

Load settings.

storage
Settings storage.
cancellationToken
CancellationToken

Retorna: Task

OnProcessAsync
protected abstract ValueTask<decimal?> OnProcessAsync(ExecutionMessage message, CancellationToken cancellationToken)
result = commissionRule.OnProcessAsync(message, cancellationToken)

To calculate commission, before Min is applied.

message
The message containing the information about the order or own trade.
cancellationToken
CancellationToken

Retorna: The commission. If the commission cannot be calculated then will be returned.

ProcessAsync
public ValueTask<decimal?> ProcessAsync(ExecutionMessage message, CancellationToken cancellationToken)
result = commissionRule.ProcessAsync(message, cancellationToken)

To calculate commission.

message
The message containing the information about the order or own trade.
cancellationToken
CancellationToken

Retorna: The commission. If the commission cannot be calculated then will be returned.

Reset
public virtual void Reset()
commissionRule.Reset()

Reiniciar estado.

SaveAsync
public virtual Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = commissionRule.SaveAsync(storage, cancellationToken)

Save settings.

storage
Settings storage.
cancellationToken
CancellationToken

Retorna: Task

UpdateTitle
protected void UpdateTitle()
commissionRule.UpdateTitle()

Actualizar o título.