CommissionRule
Die Berechnungsregel der Kommission.
Erbt von: NotifiableObject
Implementiert: ICommissionRule, IAsyncPersistable
Konstruktoren
protected CommissionRule()
commissionRule = CommissionRule()
Initialisieren Sie CommissionRule.
Eigenschaften
public decimal Min { get; set; }
value = commissionRule.Min
commissionRule.Min = value
Lower bound on a charge this rule produces. Zero means no bound.
public string Title { get; private set; }
value = commissionRule.Title
commissionRule.Title = value
Titel.
public Unit Value { get; set; }
value = commissionRule.Value
commissionRule.Value = value
Der Parameterwert.
Methoden
protected Scope EnterScope()
result = commissionRule.EnterScope()
Geben Sie den Sync-Scope ein.
Rückgabe: Anwendungsbereich
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.
public virtual Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = commissionRule.LoadAsync(storage, cancellationToken)
Load settings.
- storage
- Settings storage.
- cancellationToken
- CancellationToken
Rückgabe: Task
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.
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.
public virtual Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = commissionRule.SaveAsync(storage, cancellationToken)
Save settings.
- storage
- Settings storage.
- cancellationToken
- CancellationToken
Rückgabe: Task