Esempio n. 1
0
        internal void OnFill(SDepthData data, TType priceType, double newPrice, int newVolume)
        {
            int   volume   = data.Volume;
            TType fillType = data.FillType;

            if (fillType == TType.Unknown || fillType == TType.Fill)
            {
                fillType = priceType;
            }

            if (fillType == TType.Bid)
            {
                volume = -volume;
            }

            if (_oPrice == 0.0)
            {
                _oPrice = data.Price;
            }

            if (Listener == null)
            {
                return;
            }

            double firstPrice = 0;
            double lastPrice  = 0;

            data.GetPrices(out firstPrice, out lastPrice);
            Listener.OnFill(firstPrice, lastPrice, volume, data.FillTime);
        }
Esempio n. 2
0
        public GBigPrintData(string instr, DateTime expiryDate, double tick)
        {
            _depth      = new SDepthData(1024);
            _tickSz     = tick;
            _digits     = GetDigits(tick);
            _instrument = instr;
            _expiry     = expiryDate;

            if (tryToLoad())
            {
                return;
            }

            _timeStampList    = new List <DateTime>(16);
            _priceList        = new List <short>(128);
            _volumeList       = new List <ushort>(128);
            _secondsDeltaList = new List <ushort>(128);
        }