SlippageManagerState
StockSharp.Algo.Slippage
Default implementation of ISlippageManagerState.
Implements: ISlippageManagerState
Properties
Slippage
public decimal Slippage { get; }
value = slippageManagerState.Slippage
Total accumulated slippage.
Methods
AddPlannedPrice
public void AddPlannedPrice(long transactionId, Sides side, decimal price)
slippageManagerState.AddPlannedPrice(transactionId, side, price)
Store planned execution price for an order.
- transactionId
- Order transaction ID.
- side
- Order side.
- price
- Planned price.
AddSlippage
public void AddSlippage(decimal amount)
slippageManagerState.AddSlippage(amount)
Add to accumulated slippage.
- amount
- Amount to add.
RemovePlannedPrice
public void RemovePlannedPrice(long transactionId)
slippageManagerState.RemovePlannedPrice(transactionId)
Remove planned price for an order.
- transactionId
- Order transaction ID.
TryGetBestPrice
public bool TryGetBestPrice(SecurityId securityId, Sides side, decimal price)
result = slippageManagerState.TryGetBestPrice(securityId, side, price)
Try get best price for order side.
- securityId
- Security ID.
- side
- Order side (Buy returns ask, Sell returns bid).
- price
- Best price if found.
Returns: if price found and non-zero.
TryGetPlannedPrice
public bool TryGetPlannedPrice(long transactionId, Sides side, decimal price)
result = slippageManagerState.TryGetPlannedPrice(transactionId, side, price)
Try get planned price without removing.
- transactionId
- Order transaction ID.
- side
- Order side if found.
- price
- Planned price if found.
Returns: if found.
UpdateBestPrices
public void UpdateBestPrices(SecurityId securityId, decimal? bidPrice, decimal? askPrice, DateTime time)
slippageManagerState.UpdateBestPrices(securityId, bidPrice, askPrice, time)
Update best bid/ask prices for a security.
- securityId
- Security ID.
- bidPrice
- Best bid price (null to keep existing).
- askPrice
- Best ask price (null to keep existing).
- time
- Market data time. If both Level1 and order books are streamed, prices update only when time increases.