IQuotingBehavior
StockSharp.Algo.Strategies.Quoting
Defines the behavior for calculating the best price and determining if quoting is needed.
Methods
CalculateBestPrice
public decimal? CalculateBestPrice(Security security, IMarketDataProvider provider, Sides quotingDirection, decimal? bestBidPrice, decimal? bestAskPrice, decimal? lastTradePrice, decimal? lastTradeVolume, QuoteChange[] bids, QuoteChange[] asks)
result = iQuotingBehavior.CalculateBestPrice(security, provider, quotingDirection, bestBidPrice, bestAskPrice, lastTradePrice, lastTradeVolume, bids, asks)
Calculates the best price for quoting based on market data.
- security
- Security
- provider
- IMarketDataProvider
- quotingDirection
- The direction of quoting (Buy or Sell).
- bestBidPrice
- The best bid price in the order book.
- bestAskPrice
- The best ask price in the order book.
- lastTradePrice
- The price of the last trade.
- lastTradeVolume
- The volume of the last trade.
- bids
- Array of bid quotes from the order book.
- asks
- Array of ask quotes from the order book.
Returns: The calculated best price for quoting, or null if unavailable.
NeedQuoting
public decimal? NeedQuoting(Security security, IMarketDataProvider provider, DateTime currentTime, decimal? currentPrice, decimal? currentVolume, decimal newVolume, decimal? bestPrice)
result = iQuotingBehavior.NeedQuoting(security, provider, currentTime, currentPrice, currentVolume, newVolume, bestPrice)
Determines if quoting is required based on the current order state and market conditions.
- security
- Security
- provider
- IMarketDataProvider
- currentTime
- The current time.
- currentPrice
- The current price of the order, or null if not registered.
- currentVolume
- The current volume of the order, or null if not registered.
- newVolume
- The new volume to be quoted.
- bestPrice
- The calculated best price for quoting.
Returns: The price to quote at, or null if quoting is not needed.