CommissionRule

StockSharp.Algo.Commissions

Die Berechnungsregel der Kommission.

Erbt von: NotifiableObject

Implementiert: ICommissionRule, IAsyncPersistable

Konstruktoren

CommissionRule
protected CommissionRule()
commissionRule = CommissionRule()

Initialisieren Sie CommissionRule.

Eigenschaften

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

Titel.

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

Der Parameterwert.

Methoden

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

Geben Sie den Sync-Scope ein.

Rückgabe: Anwendungsbereich

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

Titel holen.

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

Für Prozenteinheiten, verwendet Umsatz (Preis * Volumen). Absolute Einheiten geben den absoluten Wert zurück.

price
Preisbasis (Auftrag oder Handel).
volume
Volumenbasis (Auftrag oder Handel).

Rückgabe: Kommissionswert oder Null, wenn nicht berechnet werden kann.

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

Load settings.

storage
Settings storage.
cancellationToken
CancellationToken

Rückgabe: 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

Rückgabe: 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

Rückgabe: The commission. If the commission cannot be calculated then will be returned.

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

Zustand zurücksetzen.

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

Save settings.

storage
Settings storage.
cancellationToken
CancellationToken

Rückgabe: Task

UpdateTitle
protected void UpdateTitle()
commissionRule.UpdateTitle()

Titel aktualisieren.