IMarginController
Die Steuerung der Margin-Handelslogik erfolgt per Position (Leverage), die Margin-Call-/Stop-Out-Level sind pro Portfolio (MarginCallLevel, StopOutLevel).
Methoden
public decimal CheckMarginLevel(IPortfolio portfolio, decimal unrealizedPnL)
result = iMarginController.CheckMarginLevel(portfolio, unrealizedPnL)
Berechnen Sie das aktuelle Margin-Niveau für ein Portfolio.
- portfolio
- Portfolio.
- unrealizedPnL
- Aktuelle unrealisierte PnL.
Rückgabe: Margin Level Ratio (Eigenkapital / blockiert). Gibt MaxValue zurück, wenn kein blockiertes Geld vorhanden ist.
public decimal GetRequiredMargin(decimal price, decimal volume, PositionInfo position)
result = iMarginController.GetRequiredMargin(price, volume, position)
Berechnen Sie die erforderliche Margin für einen Auftrag unter Verwendung von Positionshebel.
- price
- Bestellpreis.
- volume
- Auftragsvolumen.
- position
- Positionsinformationen (für Hebelwirkung) können null sein (verwendet Standardhebelwirkung 1).
Rückgabe: Erforderlicher Margin-Betrag.
public bool IsMarginCall(IPortfolio portfolio, decimal unrealizedPnL)
result = iMarginController.IsMarginCall(portfolio, unrealizedPnL)
Prüfen Sie, ob sich das Portfolio im Margin Call-Status befindet. Verwendet MarginCallLevel.
- portfolio
- Portfolio.
- unrealizedPnL
- Aktuelle unrealisierte PnL.
Rückgabe: Dies ist der Fall, wenn die Margin-Ebene am oder unterhalb des Margin-Aufrufschwellenwerts liegt.
public bool IsStopOut(IPortfolio portfolio, decimal unrealizedPnL)
result = iMarginController.IsStopOut(portfolio, unrealizedPnL)
Prüfen Sie, ob sich das Portfolio im Stop-Out-Zustand befindet. Verwendet EnableStopOut und StopOutLevel.
- portfolio
- Portfolio.
- unrealizedPnL
- Aktuelle unrealisierte PnL.
Rückgabe: Dies ist der Fall, wenn der Stop-Out aktiviert ist und das Margin-Niveau am oder unterhalb des Stop-Out-Schwellenwerts liegt.
public InvalidOperationException ValidateOrder(IPortfolio portfolio, decimal price, decimal volume, PositionInfo position)
result = iMarginController.ValidateOrder(portfolio, price, volume, position)
Validieren Sie, dass das Portfolio über ausreichende Mittel für die Bestellung verfügt.
- portfolio
- Portfolio zu überprüfen.
- price
- Bestellpreis.
- volume
- Auftragsvolumen.
- position
- Positionsinformationen (für Hebelwirkung). Kann null sein.
Rückgabe: Fehler bei unzureichenden Mitteln, sonst null.