Пример #1
0
        public static void Main(string[] args)
        {
            NbboServiceImpl s = new NbboServiceImpl();

            /*
             * test(s);
             * NBBO nbbo = (NBBO)s.GetNbboData("IBM");
             * Console.WriteLine(nbbo);
             */

            PricesGenerator generator = new PricesGenerator(s);

            generator.Start();
            while (true)
            {
                Console.Write("enter nbbo ticker or depth ticker(ctrl-c to kill):");
                string   cmd    = Console.ReadLine();
                string[] tokens = cmd.Split(' ');
                if (tokens.Length > 1)
                {
                    if (tokens[0].Equals("nbbo"))
                    {
                        NBBO nbbo = (NBBO)s.GetNbboData(tokens[1].ToUpper());
                        if (nbbo != null)
                        {
                            Console.WriteLine(nbbo);
                        }
                        else
                        {
                            Console.WriteLine("ticker not found");
                        }
                    }
                    else
                    {
                        KeyValuePair <string, Quote>[] depth = (KeyValuePair <string, Quote>[])s.GetMarketData(tokens[1].ToUpper());
                        if (depth != null)
                        {
                            foreach (KeyValuePair <string, Quote> item in depth)
                            {
                                Console.WriteLine(item.Value);
                            }
                        }
                        else
                        {
                            Console.WriteLine("ticker not found");
                        }
                    }
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("Please enter a ticker");

            string ticker = Console.ReadLine();

            AppDomain.CurrentDomain.ProcessExit += new EventHandler(OnProcessExit);

            priceGenerator = new PricesGenerator(NBBOService.getInstance());
            priceGenerator.Start();
            System.Threading.Thread.Sleep(1000); //Thread.Sleep(10000);



            while (true || System.Console.ReadKey() == null)
            {
                Console.WriteLine("Running");
                System.Threading.Thread.Sleep(1000);
            }
        }
Пример #3
0
        public NbboServiceImpl()
        {
            PricesGenerator generator = new PricesGenerator(this);

            generator.Start();
        }