IQuotingBehavior
StockSharp.Algo.Strategies.Quoting
定义计算最佳价格和确定是否需要引用的行为。
方法
CalculateBestPrice
public decimal? CalculateBestPrice(Security security, IMarketDataProvider provider, Sides quotingDirection, decimal? bestBidPrice, decimal? bestAskPrice, decimal? lastTradePrice, decimal? lastTradeVolume, long lastTradeSeq, QuoteChange[] bids, QuoteChange[] asks)
result = iQuotingBehavior.CalculateBestPrice(security, provider, quotingDirection, bestBidPrice, bestAskPrice, lastTradePrice, lastTradeVolume, lastTradeSeq, 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.
- lastTradeSeq
- The identity of the last trade. It stays unchanged while the same trade is presented again, so a behavior that accumulates can count each trade once.
- bids
- Array of bid quotes from the order book.
- asks
- Array of ask quotes from the order book.
返回值: 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)
确定是否需要根据当前秩序状况和市场条件引用。
- security
- 金融工具
- provider
- IMarketDataProvider
- currentTime
- 现相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相相
- currentPrice
- 订单的现价,或者未注册的无效.
- currentVolume
- 命令的当前音量, 如果没有注册, 则无效 。
- newVolume
- 新出一卷所引经.
- bestPrice
- 引用的计算出的最佳价格。
返回值: 无需引用,则引用的代价为无效。