Exemplo n.º 1
0
        // OnNxCoreMMQuote: Function to handle NxCore MMQuote messages.
        //--------------------------------------------------------------
        static unsafe void OnNxCoreMMQuote(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            // Get the symbol for category message
            String Symbol = new String(&pNxCoreMsg->coreHeader.pnxStringSymbol->String);

            // Assign a pointer to the MMQuote data
            NxCoreMMQuote *Quote = &pNxCoreMsg->coreData.MMQuote;

            if (Quote->pnxStringMarketMaker == null)
            {
                return;
            }

            // Get the market maker string
            String MarketMaker = new String(&Quote->pnxStringMarketMaker->String);

            // Get bid and ask price
            double Bid = NxCore.PriceToDouble(Quote->coreQuote.BidPrice, Quote->coreQuote.PriceType);
            double Ask = NxCore.PriceToDouble(Quote->coreQuote.AskPrice, Quote->coreQuote.PriceType);

            // Write out Symbol, MarketMaker, Time, Bid, Ask, Bidsize, Asksize, Reporting Exg
            Console.WriteLine("MMQuote for Symbol: {0:S}, MarketMaker: {1:S}  Time: {2:d}:{3:d}:{4:d}  Bid: {5:f}  Ask: {6:f}  BidSize: {7:d}  AskSise: {8:d}  Exchg: {9:d} ",
                              Symbol, MarketMaker,
                              pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                              Bid, Ask, Quote->coreQuote.BidSize, Quote->coreQuote.AskSize,
                              pNxCoreMsg->coreHeader.ReportingExg);
        }
Exemplo n.º 2
0
        // The NXCore Callback Function
        //-----------------------------
        static unsafe int OnNxCoreCallback(IntPtr pSys, IntPtr pMsg)
        {
            // Alias structure pointers to the pointers passed in.
            NxCoreSystem * pNxCoreSys = (NxCoreSystem *)pSys;
            NxCoreMessage *pNxCoreMsg = (NxCoreMessage *)pMsg;

            // Do something based on the message type
            switch (pNxCoreMsg->MessageType)
            {
            // NxCore Status Message
            case NxCore.NxMSG_STATUS:
                OnNxCoreStatus(pNxCoreSys, pNxCoreMsg);
                break;

            // NxCore Trade Message
            case NxCore.NxMSG_TRADE:
                OnNxCoreTrade(pNxCoreSys, pNxCoreMsg);
                break;

            // NxCore Level1 Quote Message
            case NxCore.NxMSG_EXGQUOTE:
                OnNxCoreExgQuote(pNxCoreSys, pNxCoreMsg);
                break;

            // NxCore Level2 Quote Message
            case NxCore.NxMSG_MMQUOTE:
                OnNxCoreMMQuote(pNxCoreSys, pNxCoreMsg);
                break;
            }

            // Continue running the tape
            return((int)NxCore.NxCALLBACKRETURN_CONTINUE);
        }
Exemplo n.º 3
0
        static unsafe void OnNxCoreStatus(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            if (DOSAVESTATE)
            {
                if (pNxCoreSys->nxTime.MsOfDay >= nextstatesavetime)
                {
                    D("saving state at: " + nextstatesavetime + " " + statefilepath);
                    NxCore.SaveState(statefilepath, NxCore.NxSAVESTATE_ONEPASS);
                    if (nextstatesavetime == 0)
                    {
                        nextstatesavetime = pNxCoreSys->nxTime.MsOfDay;
                    }
                    nextstatesavetime += savestateint;
                    D("save complete.  next save time: " + nextstatesavetime);
                }
            }
            STATUS = pNxCoreSys->StatusData;
            // Print the specific NxCore status message
            switch (pNxCoreSys->Status)
            {
            case NxCore.NxCORESTATUS_COMPLETE:
                D("NxCore Complete Message.");
                break;

            case NxCore.NxCORESTATUS_INITIALIZING:
                D("NxCore Initialize Message.");
                break;

            case NxCore.NxCORESTATUS_SYNCHRONIZING:
                D("NxCore Synchronizing Message.");
                break;

            case NxCore.NxCORESTATUS_WAITFORCOREACCESS:
            {
                //D("NxCore Wait For Access.");
                break;
            }

            case NxCore.NxCORESTATUS_RESTARTING_TAPE:
                D("NxCore Restart Tape Message.");
                break;

            case NxCore.NxCORESTATUS_ERROR:
                D("NxCore Error.");
                break;

            case NxCore.NxCORESTATUS_RUNNING:
                break;

            case NxCore.NxCORESTATUS_LOADED_STATE:
                D("Nxcore has been loaded from a saved state.");
                break;

            case NxCore.NxCORESTATUS_SAVING_STATE:
                D("Nxcore is now saving it's current state.");
                break;
            }
        }
Exemplo n.º 4
0
        static unsafe void OnNxCoreSymbolSpin(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            String Symbol = new string(&pNxCoreMsg->coreHeader.pnxStringSymbol->String);

            if (symbolsToImport.Contains(Symbol.Remove(0, 1)))
            {
                pNxCoreMsg->coreHeader.pnxStringSymbol->UserData1 = 1;
                Console.WriteLine("SET");
                csvs[Symbol.Remove(0, 1)] = "MsOfDay, Time,Price,Size\n";
            }
        }
Exemplo n.º 5
0
        // OnNxCoreTrade: Function to handle NxCore Trade messages.
        //--------------------------------------------------------------
        static unsafe void OnNxCoreTrade(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            // Get the symbol for category message
            String Symbol = new String(&pNxCoreMsg->coreHeader.pnxStringSymbol->String);

            if (pNxCoreMsg->coreHeader.pnxStringSymbol->UserData1 == 1)
            {
                //if (Symbol.ToString() == "eCSIQ") {

                // Assign a pointer to the Trade data
                NxCoreTrade *Trade = &pNxCoreMsg->coreData.Trade;

                // Get the price and net change
                double Price       = NxCore.PriceToDouble(Trade->Price, Trade->PriceType);
                double NetChange   = NxCore.PriceToDouble(Trade->NetChange, Trade->PriceType);
                int    Hour        = pNxCoreMsg->coreHeader.nxExgTimestamp.Hour;
                int    Minute      = pNxCoreMsg->coreHeader.nxExgTimestamp.Minute;
                int    Second      = pNxCoreMsg->coreHeader.nxExgTimestamp.Second;
                int    Millisecond = pNxCoreMsg->coreHeader.nxExgTimestamp.Millisecond;
                int    MsOfDay     = Convert.ToInt32(pNxCoreMsg->coreHeader.nxExgTimestamp.MsOfDay);
                string TimeOfTrade = Hour.ToString() + ":" + Minute.ToString() + ":" + Second.ToString() + ":" + Millisecond.ToString();
                string Volume      = pNxCoreMsg->coreData.Trade.Size.ToString();

                //Check that price is within BBO or not tradethruexempt
                int tradeCondition = pNxCoreMsg->coreData.Trade.TradeCondition;
                //
                //var extendedTradeCondition = pNxCoreMsg->coreData.Trade.ExtTradeConditions;

                if (tradeCondition == 108) //TradeThruExempt
                {
                    //Get BBO
                    double bestBidPrice = pNxCoreMsg->coreData.ExgQuote.BestBidPrice;
                    double bestAskPrice = pNxCoreMsg->coreData.ExgQuote.BestAskPrice;

                    Console.WriteLine("Trade for Symbol: {0:S}, Time: {1:d}:{2:d}:{3:d}  Price: {4:f}    BBO:  {5}  {6}   TradeCondition:  {7}", Symbol,
                                      pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                                      Price, bestBidPrice, bestAskPrice, tradeCondition);
                }

                var newLine = string.Format("{0},{1},{2},{3}", MsOfDay, TimeOfTrade, Price, Volume);
                csvs[Symbol.Remove(0, 1)] += newLine + "\n";

                // Write out Symbol, Time, Price, NetChg, Size, Reporting Exg

                /*Console.WriteLine("Trade for Symbol: {0:S}, Time: {1:d}:{2:d}:{3:d}  Price: {4:f}  NetChg: {5:f}  Size: {6:d}  Exchg: {7:d} ",
                 *                Symbol,
                 *                pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                 *                Price, NetChange, Trade->Size,
                 *                pNxCoreMsg->coreHeader.ReportingExg);*/
            }
        }
Exemplo n.º 6
0
        // OnNxCoreStatus: Function to handle NxCore Status messages
        //----------------------------------------------------------
        static unsafe void OnNxCoreStatus(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            // If a Minute has elapsed print the NxCore system time.
            // NOTE: The last time sent is 24:00:00. Don't print that
            // time as DateTime() will fail...24:00:00 is not actually
            // a real time value.
            if ((pNxCoreSys->ClockUpdateInterval >= NxCore.NxCLOCK_MINUTE) &&
                (pNxCoreSys->nxTime.Hour < 24))
            {
                DateTime thisTime = new DateTime(pNxCoreSys->nxDate.Year,
                                                 pNxCoreSys->nxDate.Month,
                                                 pNxCoreSys->nxDate.Day,
                                                 pNxCoreSys->nxTime.Hour,
                                                 pNxCoreSys->nxTime.Minute,
                                                 pNxCoreSys->nxTime.Second);

                timeInTapeFile = thisTime;
            }

            // Print the specific NxCore status message
            switch (pNxCoreSys->Status)
            {
            case NxCore.NxCORESTATUS_COMPLETE:
                Console.WriteLine("NxCore Complete Message.");
                break;

            case NxCore.NxCORESTATUS_INITIALIZING:
                Console.WriteLine("NxCore Initialize Message.");
                break;

            case NxCore.NxCORESTATUS_SYNCHRONIZING:
                Console.WriteLine("NxCore Synchronizing Message.");
                break;

            case NxCore.NxCORESTATUS_WAITFORCOREACCESS:
                Console.WriteLine("NxCore Wait For Access.");
                break;

            case NxCore.NxCORESTATUS_RESTARTING_TAPE:
                Console.WriteLine("NxCore Restart Tape Message.");
                break;

            case NxCore.NxCORESTATUS_ERROR:
                Console.WriteLine("NxCore Error.");
                break;

            case NxCore.NxCORESTATUS_RUNNING:
                break;
            }
        }
Exemplo n.º 7
0
        // OnNxCoreTrade: Function to handle NxCore Trade messages.
        //--------------------------------------------------------------
        static unsafe void OnNxCoreTrade(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            // Get the symbol for category message
            String Symbol = new String(&pNxCoreMsg->coreHeader.pnxStringSymbol->String);

            // Assign a pointer to the Trade data
            NxCoreTrade *Trade = &pNxCoreMsg->coreData.Trade;

            // Get the price and net change
            double Price     = NxCore.PriceToDouble(Trade->Price, Trade->PriceType);
            double NetChange = NxCore.PriceToDouble(Trade->NetChange, Trade->PriceType);

            // Write out Symbol, Time, Price, NetChg, Size, Reporting Exg
            Console.WriteLine("Trade for Symbol: {0:S}, Time: {1:d}:{2:d}:{3:d}  Price: {4:f}  NetChg: {5:f}  Size: {6:d}  Exchg: {7:d} ",
                              Symbol,
                              pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                              Price, NetChange, Trade->Size,
                              pNxCoreMsg->coreHeader.ReportingExg);
        }
Exemplo n.º 8
0
        // The NXCore Callback Function
        //-----------------------------
        static unsafe int OnNxCoreCallback(IntPtr pSys, IntPtr pMsg)
        {
            // Alias structure pointers to the pointers passed in.
            NxCoreSystem * pNxCoreSys = (NxCoreSystem *)pSys;
            NxCoreMessage *pNxCoreMsg = (NxCoreMessage *)pMsg;

            // Do something based on the message type
            switch (pNxCoreMsg->MessageType)
            {
            // NxCore Status Message
            case NxCore.NxMSG_STATUS:
                OnNxCoreStatus(pNxCoreSys, pNxCoreMsg);
                break;

            // NxCore Trade Message
            case NxCore.NxMSG_TRADE:
                //if (pNxCoreMsg->coreHeader.nxExgTimestamp.Hour > 8 && pNxCoreMsg->coreHeader.nxExgTimestamp.Minute > 35) return 1;
                OnNxCoreTrade(pNxCoreSys, pNxCoreMsg);
                break;

            case NxCore.NxMSG_SYMBOLSPIN:
                OnNxCoreSymbolSpin(pNxCoreSys, pNxCoreMsg);
                break;

                // NxCore Level1 Quote Message
                //case NxCore.NxMSG_EXGQUOTE:
                //  OnNxCoreExgQuote(pNxCoreSys, pNxCoreMsg);
                //  break;

                // NxCore Level2 Quote Message
                //case NxCore.NxMSG_MMQUOTE:
                // OnNxCoreMMQuote(pNxCoreSys, pNxCoreMsg);
            }

            if (killThread)
            {
                return((int)NxCore.NxCALLBACKRETURN_STOP);
            }
            // Continue running the tape
            return((int)NxCore.NxCALLBACKRETURN_CONTINUE);
        }
Exemplo n.º 9
0
 static unsafe void OnNxCoreMMQuote(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
 {
 }
Exemplo n.º 10
0
        static unsafe void OnNxCoreExgQuote(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            if (keepcurrent && (STATUS < 4))
            {
                return;
            }
            if (DOLIVESKIPTEST)
            {
                if (pNxCoreSys->nxTime.MsOfDay < (DateTime.UtcNow.TimeOfDay.TotalMilliseconds - (DateTime.Now.IsDaylightSavingTime() ? (1000 * 60 * 60 * 4) : (1000 * 60 * 60 * 5))))
                {
                    return;
                }
                DOLIVESKIPTEST = false;
                D("NxCore starting realtime data");
            }
            // Get the symbol for category message

            int idx = _nxsyms.getindex(new string(&pNxCoreMsg->coreHeader.pnxStringSymbol->String));

            if (idx < 0)
            {
                return;
            }
            if (!_nxsyms[idx])
            {
                return;
            }

            // Assign a pointer to the ExgQuote data
            NxCoreExgQuote *Quote = &pNxCoreMsg->coreData.ExgQuote;
            NxCoreQuote     cq    = Quote->coreQuote;
            // Get bid and ask price
            double bid  = 0;
            double ask  = 0;
            int    bs   = 0;
            int    os   = 0;
            string be   = string.Empty;
            string oe   = string.Empty;
            bool   bbid = false;
            bool   bask = false;

            if ((cq.BidPriceChange != 0) || (cq.BidSizeChange != 0))
            {
                bid  = NxCore.PriceToDouble(Quote->coreQuote.BidPrice, Quote->coreQuote.PriceType);
                bs   = Quote->coreQuote.BidSize;
                be   = excode2name(Quote->BestBidExg);
                bbid = true;
            }
            if ((cq.AskPriceChange != 0) || (cq.AskSizeChange != 0))
            {
                ask  = NxCore.PriceToDouble(Quote->coreQuote.AskPrice, Quote->coreQuote.PriceType);
                os   = Quote->coreQuote.AskSize;
                oe   = excode2name(Quote->BestAskExg);
                bask = true;
            }
            if (bask || bbid)
            {
                NxTime time   = pNxCoreMsg->coreHeader.nxExgTimestamp;
                int    tltime = time.Hour * 10000 + time.Minute * 100 + time.Second;
                NxDate date   = pNxCoreMsg->coreHeader.nxSessionDate;
                int    tldate = (int)date.Year * 10000 + (int)date.Month * 100 + (int)date.Day;
                Tick   k      = new TickImpl();
                k.symbol = _realsym2nxidx.getlabel(idx);
                k.date   = tldate;
                k.time   = tltime;
                if (bask && bbid)
                {
                    k.bid = (decimal)bid;
                    k.bs  = bs;
                    k.be  = be;
                    k.ask = (decimal)ask;
                    k.os  = os;
                    k.oe  = oe;
                }
                else if (bbid)
                {
                    k.bid = (decimal)bid;
                    k.bs  = bs;
                    k.be  = be;
                }
                else
                {
                    k.ask = (decimal)ask;
                    k.os  = os;
                    k.oe  = oe;
                }
                try
                {
                    tl.newTick(k);
                }
                catch (Exception ex)
                {
                    D("bad tick: " + k.ToString() + " " + ex.Message + ex.StackTrace);
                }
            }
        }
Exemplo n.º 11
0
        static unsafe void OnNxCoreTrade(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            if (keepcurrent && (STATUS < 4))
            {
                return;
            }
            if (DOLIVESKIPTEST)
            {
                if (pNxCoreSys->nxTime.MsOfDay < (DateTime.UtcNow.TimeOfDay.TotalMilliseconds - (DateTime.Now.IsDaylightSavingTime() ? (1000 * 60 * 60 * 4) : (1000 * 60 * 60 * 5))))
                {
                    return;
                }
                DOLIVESKIPTEST = false;
                D("NxCore starting realtime data");
            }
            // Get the symbol for category message

            int idx = _nxsyms.getindex(new string(&pNxCoreMsg->coreHeader.pnxStringSymbol->String));

            if (idx < 0)
            {
                return;
            }
            if (!_nxsyms[idx])
            {
                return;
            }
            // Assign a pointer to the Trade data
            NxCoreTrade *Trade = &pNxCoreMsg->coreData.Trade;
            // Get the price and net change
            double Price = NxCore.PriceToDouble(Trade->Price, Trade->PriceType);
            //double NetChange = NxCore.PriceToDouble(Trade->NetChange, Trade->PriceType);
            NxTime time   = pNxCoreMsg->coreHeader.nxExgTimestamp;
            int    tltime = time.Hour * 10000 + time.Minute * 100 + time.Second;
            NxDate date   = pNxCoreMsg->coreHeader.nxSessionDate;
            int    tldate = (int)date.Year * 10000 + (int)date.Month * 100 + (int)date.Day;
            string ex     = excode2name(pNxCoreMsg->coreHeader.ReportingExg);
            int    size   = (int)Trade->Size;

            // check for index
            if (size <= 0)
            {
                return;
            }
            Tick k = new TickImpl();

            k.symbol = _realsym2nxidx.getlabel(idx);
            k.date   = tldate;
            k.time   = tltime;
            k.trade  = (decimal)Price;
            k.ex     = ex;
            k.size   = size;
            try
            {
                tl.newTick(k);
            }
            catch (Exception e)
            {
                D("bad tick: " + k.symbol + " " + Price + " " + size + " " + ex + " " + e.Message + e.StackTrace);
            }
        }
Exemplo n.º 12
0
        // OnNxCoreTrade: Function to handle NxCore Trade messages.
        //--------------------------------------------------------------
        static unsafe void OnNxCoreTrade(NxCoreSystem *pNxCoreSys, NxCoreMessage *pNxCoreMsg)
        {
            // Get the symbol for category message
            String Symbol = new String(&pNxCoreMsg->coreHeader.pnxStringSymbol->String);

            if (pNxCoreMsg->coreHeader.pnxStringSymbol->UserData1 == 1)
            {
                //if (Symbol.ToString() == "eCSIQ") {

                // Assign a pointer to the Trade data
                NxCoreTrade *Trade = &pNxCoreMsg->coreData.Trade;

                // Get the price and net change
                double Price       = NxCore.PriceToDouble(Trade->Price, Trade->PriceType);
                double NetChange   = NxCore.PriceToDouble(Trade->NetChange, Trade->PriceType);
                int    Hour        = pNxCoreMsg->coreHeader.nxExgTimestamp.Hour;
                int    Minute      = pNxCoreMsg->coreHeader.nxExgTimestamp.Minute;
                int    Second      = pNxCoreMsg->coreHeader.nxExgTimestamp.Second;
                int    Millisecond = pNxCoreMsg->coreHeader.nxExgTimestamp.Millisecond;
                int    MsOfDay     = Convert.ToInt32(pNxCoreMsg->coreHeader.nxExgTimestamp.MsOfDay);
                string TimeOfTrade = Hour.ToString() + ":" + Minute.ToString() + ":" + Second.ToString() + ":" + Millisecond.ToString();
                string Volume      = pNxCoreMsg->coreData.Trade.Size.ToString();

                //Check that price is not tradethruexempt in the extended trade conditions - for future imports
                //int tradeCondition = pNxCoreMsg->coreData.Trade.ExtTradeConditions[]

                var   tradeCondition          = pNxCoreMsg->coreData.Trade.TradeCondition;
                byte *extendedTradeConditions = pNxCoreMsg->coreData.Trade.ExtTradeConditions;


                int len = 0;

                for (int i = 0; i < 10; i++)
                {
                    try
                    {
                        string aaa = extendedTradeConditions[i].ToString();
                        if (aaa == "255")
                        {
                            break;
                        }
                        len++;
                    }
                    catch (Exception)
                    {
                        break;
                    }
                }

                byte[] _extendedTradeConditions = new byte[len];
                Marshal.Copy((IntPtr)extendedTradeConditions, _extendedTradeConditions, 0, len);


                Debug.WriteLine(tradeCondition);

                foreach (int condition in _extendedTradeConditions)
                {
                    Debug.WriteLine(condition);
                }
                Debug.WriteLine("");
                Debug.WriteLine("------------------------");
                Debug.WriteLine("");

                //string extCondition = extendedTradeConditions[0].ToString();



                //Debug.WriteLine(extCondition);

                int a = 1;

                /*if (tradeCondition == 108) //TradeThruExempt
                 * {
                 *  //Get BBO
                 *  double bestBidPrice = pNxCoreMsg->coreData.ExgQuote.BestBidPrice;
                 *  double bestAskPrice = pNxCoreMsg->coreData.ExgQuote.BestAskPrice;
                 *
                 *  Console.WriteLine("Trade for Symbol: {0:S}, Time: {1:d}:{2:d}:{3:d}  Price: {4:f}    BBO:  {5}  {6}   TradeCondition:  {7}", Symbol,
                 *      pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                 *                Price, bestBidPrice, bestAskPrice, tradeCondition);
                 * }*/

                if (len == 0)
                {
                    var newLine = string.Format("{0},{1},{2},{3},{4}", MsOfDay, TimeOfTrade, Price, Volume, tradeCondition.ToString());
                    csvs[Symbol.Remove(0, 1)] += newLine + "\n";
                }

                if (len == 1)
                {
                    var newLine = string.Format("{0},{1},{2},{3},{4},{5}", MsOfDay, TimeOfTrade, Price, Volume, tradeCondition.ToString(), _extendedTradeConditions[0].ToString());
                    csvs[Symbol.Remove(0, 1)] += newLine + "\n";
                }

                if (len == 2)
                {
                    var newLine = string.Format("{0},{1},{2},{3},{4},{5},{6}", MsOfDay, TimeOfTrade, Price, Volume, tradeCondition.ToString(), _extendedTradeConditions[0].ToString(),
                                                _extendedTradeConditions[1].ToString());
                    csvs[Symbol.Remove(0, 1)] += newLine + "\n";
                }

                if (len == 3)
                {
                    var newLine = string.Format("{0},{1},{2},{3},{4},{5},{6},{7}", MsOfDay, TimeOfTrade, Price, Volume, tradeCondition.ToString(), _extendedTradeConditions[0].ToString(),
                                                _extendedTradeConditions[1].ToString(), _extendedTradeConditions[2].ToString());
                    csvs[Symbol.Remove(0, 1)] += newLine + "\n";
                }

                // Write out Symbol, Time, Price, NetChg, Size, Reporting Exg

                /*Console.WriteLine("Trade for Symbol: {0:S}, Time: {1:d}:{2:d}:{3:d}  Price: {4:f}  NetChg: {5:f}  Size: {6:d}  Exchg: {7:d} ",
                 *                Symbol,
                 *                pNxCoreMsg->coreHeader.nxExgTimestamp.Hour, pNxCoreMsg->coreHeader.nxExgTimestamp.Minute, pNxCoreMsg->coreHeader.nxExgTimestamp.Second,
                 *                Price, NetChange, Trade->Size,
                 *                pNxCoreMsg->coreHeader.ReportingExg);*/
            }
        }