private void processMessage(Message msg)
        {
            Element data    = msg.GetElement(BAR_DATA).GetElement(BAR_TICK_DATA);
            int     numBars = data.NumValues;

            System.Console.WriteLine("Response contains " + numBars + " bars");
            System.Console.WriteLine("Datetime\t\tOpen\t\tHigh\t\tLow\t\tClose" +
                                     "\t\tNumEvents\tVolume");
            for (int i = 0; i < numBars; ++i)
            {
                Element         bar         = data.GetValueAsElement(i);
                Datetime        time        = bar.GetElementAsDate(TIME);
                double          open        = bar.GetElementAsFloat64(OPEN);
                double          high        = bar.GetElementAsFloat64(HIGH);
                double          low         = bar.GetElementAsFloat64(LOW);
                double          close       = bar.GetElementAsFloat64(CLOSE);
                int             numEvents   = bar.GetElementAsInt32(NUM_EVENTS);
                long            volume      = bar.GetElementAsInt64(VOLUME);
                System.DateTime sysDatetime = time.ToSystemDateTime();
                System.Console.WriteLine(
                    sysDatetime.ToString("s") + "\t" +
                    open.ToString("C") + "\t\t" +
                    high.ToString("C") + "\t\t" +
                    low.ToString("C") + "\t\t" +
                    close.ToString("C") + "\t\t" +
                    numEvents + "\t\t" +
                    volume);
            }
        }
        private void processMessage(Message msg)
        {
            Element data     = msg.GetElement(TICK_DATA).GetElement(TICK_DATA);;
            int     numItems = data.NumValues;

            System.Console.WriteLine("TIME\t\t\tTYPE\tVALUE\t\tSIZE\tCC");
            System.Console.WriteLine("----\t\t\t----\t-----\t\t----\t--");
            for (int i = 0; i < numItems; ++i)
            {
                Element  item  = data.GetValueAsElement(i);
                Datetime time  = item.GetElementAsDate(TIME);
                string   type  = item.GetElementAsString(TYPE);
                double   value = item.GetElementAsFloat64(VALUE);
                int      size  = item.GetElementAsInt32(SIZE);
                string   cc    = "";
                if (item.HasElement(COND_CODE))
                {
                    cc = item.GetElementAsString(COND_CODE);
                }

                System.DateTime sysDatetime =
                    new System.DateTime(time.Year, time.Month, time.DayOfMonth,
                                        time.Hour, time.Minute, time.Second, time.MilliSecond);
                System.Console.WriteLine(
                    sysDatetime.ToString("s") + "\t" +
                    type + "\t" +
                    value.ToString("C") + "\t\t" +
                    size + "\t" +
                    cc);
            }
        }