Пример #1
0
 /// <summary>
 /// OHLCFull constructor.
 /// </summary>
 public OHLCFull(SmallDecimal open, SmallDecimal high, SmallDecimal low, SmallDecimal close, int volume = 0, decimal moneyVolume = 0M, int tradeCount = 0, int openInterest = 0)
 {
     _ohlcv        = new OHLCV(open, high, low, close, volume);
     _value        = moneyVolume;
     _tradeCount   = tradeCount;
     _openInterest = openInterest;
 }
Пример #2
0
 /// <summary>
 /// Tick constructor.
 /// </summary>
 public Tick(DateTime dateTimeUtc, SmallDecimal price, int volume)
 {
     // TODO (docs) need to document this behavior
     if (dateTimeUtc.Kind == DateTimeKind.Local)
     {
         throw new ArgumentException(@"dateTime kind must be UTC or unspecified", nameof(dateTimeUtc));
     }
     _dateTimeUtcTicks = dateTimeUtc.Ticks;
     _quote            = new Quote(price, volume);
 }
Пример #3
0
 public MarketDepth2(SmallDecimal largeAskPrice, int largeAskSize, int largeAskOffset,
                     SmallDecimal smallAskPrice, int smallAskSize, int smallAskOffset,
                     SmallDecimal smallBidPrice, int smallBidSize, int smallBidOffset,
                     SmallDecimal largeBidPrice, int largeBidSize, int largeBidOffset)
 {
     _largeAsk = new Quote(largeAskPrice, largeAskSize, largeAskOffset);
     _smallAsk = new Quote(smallAskPrice, smallAskSize, smallAskOffset);
     _smallBid = new Quote(smallBidPrice, smallBidSize, smallBidOffset);
     _largeBid = new Quote(largeBidPrice, largeBidSize, largeBidOffset);
 }
Пример #4
0
 /// <summary>
 /// OHLCV constructor.
 /// </summary>
 public OHLCV(SmallDecimal open, SmallDecimal high, SmallDecimal low, SmallDecimal close, int volume)
 {
     checked
     {
         // NB it is probably doable to adjust exponents, but
         // providing prices with different precision indicates
         // application logic flaw
         if (open.Exponent != high.Exponent || open.Exponent != low.Exponent || open.Exponent != close.Exponent)
         {
             throw new ArgumentException("Precision of all prices must be the same");
         }
         _close  = close;
         _open   = (int)(open.Mantissa - close.Mantissa);
         _high   = (int)(high.Mantissa - close.Mantissa);
         _low    = (int)(low.Mantissa - close.Mantissa);
         _volume = volume;
     }
 }
Пример #5
0
 public MarketDepth(SmallDecimal smallAskPrice, int smallAskSize, int smallAskOffset,
                    SmallDecimal smallBidPrice, int smallBidSize, int smallBidOffset)
 {
     _smallAsk = new Quote(smallAskPrice, smallAskSize, smallAskOffset);
     _smallBid = new Quote(smallBidPrice, smallBidSize, smallBidOffset);
 }
Пример #6
0
 /// <summary>
 /// Quote constructor.
 /// </summary>
 public QuoteDecimal(SmallDecimal price, SmallDecimal volume)
 {
     _price  = price;
     _volume = volume;
 }
Пример #7
0
 public Quote(SmallDecimal price, int volume, int tag)
 {
     _price  = price;
     _volume = volume;
     _tag    = tag;
 }
Пример #8
0
 /// <summary>
 /// Quote constructor.
 /// </summary>
 public Quote(SmallDecimal price, int volume)
 {
     _price  = price;
     _volume = volume;
     _tag    = default;
 }