Exemplo n.º 1
0
        //! [tickprice]
        public virtual void tickPrice(int tickerId, int field, double price, TickAttrib attribs)
        {
            //  Console.WriteLine("Tick Priceeee. Ticker Id:"+tickerId+", Field: "+field+", Price: "+price+", CanAutoExecute: "+attribs.CanAutoExecute +
            //       ", PastLimit: " + attribs.PastLimit + ", PreOpen: " + attribs.PreOpen);

            if ((field == 4) || (field == 68))
            {
                mkt_price = price;                                // tickType 4 is last, ticktype 68 is delayed last
            }
            if (field == 2)
            {
                ask_price = price;              // check TickType.cs;  type 2 is ask; type 1 is bid
            }
            if (field == 1)
            {
                bid_price = price;
            }
        }
Exemplo n.º 2
0
 public virtual void tickPrice(int tickerId, int field, double price, TickAttrib attribs)
 {
 }
Exemplo n.º 3
0
 public void tickByTickBidAsk(int reqId, long time, double bidPrice, double askPrice, int bidSize, int askSize, TickAttrib attribs)
 {
 }
Exemplo n.º 4
0
 public void tickByTickAllLast(int reqId, int tickType, long time, double price, int size, TickAttrib attribs, string exchange, string specialConditions)
 {
 }
Exemplo n.º 5
0
        //! [tickbytickalllast]

        //! [tickbytickbidask]
        public void tickByTickBidAsk(int reqId, long time, double bidPrice, double askPrice, int bidSize, int askSize, TickAttrib attribs)
        {
            Console.WriteLine("Tick-By-Tick. Request Id: {0}, TickType: BidAsk, Time: {1}, BidPrice: {2}, AskPrice: {3}, BidSize: {4}, AskSize: {5}, BidPastLow: {6}, AskPastHigh: {7}",
                              reqId, Util.UnixSecondsToString(time, "yyyyMMdd-HH:mm:ss zzz"), bidPrice, askPrice, bidSize, askSize, attribs.BidPastLow, attribs.AskPastHigh);
        }
Exemplo n.º 6
0
        //! [historicaltickslast]

        //! [tickbytickalllast]
        public void tickByTickAllLast(int reqId, int tickType, long time, double price, int size, TickAttrib attribs, string exchange, string specialConditions)
        {
            Console.WriteLine("Tick-By-Tick. Request Id: {0}, TickType: {1}, Time: {2}, Price: {3}, Size: {4}, Exchange: {5}, Special Conditions: {6}, PastLimit: {7}, Unreported: {8}",
                              reqId, tickType == 1 ? "Last" : "AllLast", Util.UnixSecondsToString(time, "yyyyMMdd-HH:mm:ss zzz"), price, size, exchange, specialConditions, attribs.PastLimit, attribs.Unreported);
        }