/// <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; }
/// <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); }
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); }
/// <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; } }
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); }
/// <summary> /// Quote constructor. /// </summary> public QuoteDecimal(SmallDecimal price, SmallDecimal volume) { _price = price; _volume = volume; }
public Quote(SmallDecimal price, int volume, int tag) { _price = price; _volume = volume; _tag = tag; }
/// <summary> /// Quote constructor. /// </summary> public Quote(SmallDecimal price, int volume) { _price = price; _volume = volume; _tag = default; }