Ejemplo n.º 1
0
 /// <summary>
 /// Construct a market depth object with the specified instrument key and maximum depth
 /// </summary>
 /// <param name="key">InstrumentKey for the TTInstrument associated with this depth</param>
 /// <param name="maxDepthCount">The maximum number of depth levels allowed for the associated instrument</param>
 public TTMarketDepth(int maxDepthCount)
 {
     _depthCount  = maxDepthCount;
     _marketDepth = new TTMarketDepthLevel[maxDepthCount];
     for (int i = 0; i < maxDepthCount; i++)
     {
         _marketDepth[i] = new TTMarketDepthLevel();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Set the market depth at a specified level by specifying bid/ask price/quantity
 /// </summary>
 /// <param name="level">market depth level to change</param>
 /// <param name="bid">bid price</param>
 /// <param name="bidQty">bid quantity</param>
 /// <param name="ask">ask price</param>
 /// <param name="askQty">ask quantity</param>
 public void SetDepth(int level, Price bid, Quantity bidQty, Price ask, Quantity askQty)
 {
     if (_marketDepth[level] == null)
     {
         _marketDepth[level] = new TTMarketDepthLevel();
     }
     _marketDepth[level].Bid    = bid;
     _marketDepth[level].BidQty = bidQty;
     _marketDepth[level].Ask    = ask;
     _marketDepth[level].AskQty = askQty;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Index into the market depth levels (use like marketDepth[2] to return level 2 market depth)
 /// </summary>
 /// <param name="index">market depth level to return</param>
 /// <returns>MarketDepthLevel object containing market depth for the specified level</returns>
 public TTMarketDepthLevel this[int index]
 {
     get
     {
         return(_marketDepth[index]);
     }
     set
     {
         if (_marketDepth[index] == null)
         {
             _marketDepth[index] = new TTMarketDepthLevel();
         }
         _marketDepth[index].Bid    = value.Bid;
         _marketDepth[index].BidQty = value.BidQty;
         _marketDepth[index].Ask    = value.Ask;
         _marketDepth[index].AskQty = value.AskQty;
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Set the market depth at a specified level
 /// </summary>
 /// <param name="level">market depth level to change</param>
 /// <param name="depthLevel">new MarketDepthLevel object for the specified level</param>
 public void SetDepth(int level, TTMarketDepthLevel depthLevel)
 {
     SetDepth(level, depthLevel.Bid, depthLevel.BidQty, depthLevel.Ask, depthLevel.AskQty);
 }