public void Imbalance()
        {
            // make sure we have none sent
            Assert.AreEqual(0, imbalances);

            // send one
            s.newImbalance(new ImbalanceImpl(SYM, "NYSE", 100000, 154000, 0, 0, 0));

            // make sure we got it
            Assert.AreEqual(1, imbalances);
        }
Exemple #2
0
        void stiQuote_OnSTIQuoteUpdate(ref structSTIQuoteUpdate q)
        {
            Tick k = new TickImpl(q.bstrSymbol);

            k.bid = (decimal)q.fBidPrice;
            k.ask = (decimal)q.fAskPrice;
            k.bs  = q.nBidSize / 100;
            k.os  = q.nAskSize / 100;
            if (q.bstrExch != "*")
            {
                k.ex = q.bstrExch;
            }
            if (q.bstrBidExch != "*")
            {
                k.be = q.bstrBidExch;
            }
            if (q.bstrAskExch != "*")
            {
                k.oe = q.bstrAskExch;
            }
            int now = Convert.ToInt32(q.bstrUpdateTime);

            k.date = Util.ToTLDate(DateTime.Now);
            int sec = now % 100;

            k.time  = now;
            k.trade = (decimal)q.fLastPrice;
            k.size  = q.nLastSize;
            tl.newTick(k);
            if ((q.bValidMktImb == 0) || !imbalance)
            {
                return;
            }
            tl.newImbalance(new ImbalanceImpl(k.symbol, k.ex, q.nMktImbalance, k.time, 0, 0, 0));
        }