Пример #1
0
 public void prettyPrintEntries(MamdaOrderBook book)
 {
     if (myQuietModeLevel < 2)
     {
         Console.WriteLine("Book for: " + book.getSymbol());
     }
     if (myQuietModeLevel < 1)
     {
         Console.WriteLine("    ID/NUM         TIME      SIZE   PRICE");
     }
     prettyPrintEntriesSide(book.getBidLevels(), "BID");
     prettyPrintEntriesSide(book.getAskLevels(), "ASK");
 }
Пример #2
0
            public void prettyPrintLevels(MamdaOrderBook  book)
            {
                IEnumerator bidEnum = book.getBidLevels().GetEnumerator();
                IEnumerator askEnum = book.getAskLevels().GetEnumerator();
                bool bidHasNext = bidEnum.MoveNext();
                bool askHasNext = askEnum.MoveNext();

                if (myQuietModeLevel<2)
                {
                    Console.WriteLine ("Book for: " + book.getSymbol());
                }
                if (myQuietModeLevel<1)
                {
                    Console.WriteLine ("        Time     Num  Size      Price      Act | Act     Price   Size    Num       Time  ");
                }

                while (bidHasNext || askHasNext)
                {
                    if (bidHasNext)
                    {
                        MamdaOrderBookPriceLevel bidLevel = (MamdaOrderBookPriceLevel)bidEnum.Current;
                        if (myQuietModeLevel < 1)
                        {
                            Console.Write("   ");
                            paddedPrint(bidLevel.getTime().ToString("hh:mm:ss.FFF"), 12, false);
                            paddedPrint(bidLevel.getNumEntries(), 4, false);
                            paddedPrint(bidLevel.getSize(), 7, false);
                            paddedPrintPrice(bidLevel.getPrice(), 12, false);
                            Console.Write (" ");
                            paddedPrint(bidLevel.getAction(), 7, false);
                            Console.Write (" ");
                        }
                        bidHasNext = bidEnum.MoveNext();
                    }
                    else
                    {
                        if (myQuietModeLevel < 1)
                            Console.Write ("                                               ");
                    }
                    if (myQuietModeLevel < 1)
                    {
                        Console.Write("|");
                    }

                    if(askHasNext)
                    {
                        MamdaOrderBookPriceLevel askLevel = (MamdaOrderBookPriceLevel)askEnum.Current;
                        if (myQuietModeLevel < 1)
                        {
                            Console.Write ("  ");
                            Console.Write (askLevel.getAction());
                            Console.Write ("  ");
                            paddedPrintPrice(askLevel.getPrice(), 12, true);
                            Console.Write (" ");
                            paddedPrint(askLevel.getSize(), 7, true);
                            Console.Write (" ");
                            paddedPrint(askLevel.getNumEntries(), 6, true);
                            Console.Write (" ");
                            paddedPrint(askLevel.getTime().ToString("hh:mm:ss.FFF"), 12, true);
                        }
                        askHasNext = askEnum.MoveNext();
                    }
                    if (myQuietModeLevel < 1)
                    {
                        Console.WriteLine("");
                    }
                }
                if (myQuietModeLevel < 1)
                {
                    Console.WriteLine("");
                }
            }
Пример #3
0
 public void prettyPrintEntries(MamdaOrderBook book)
 {
     if (myQuietModeLevel < 2)
     {
         Console.WriteLine ("Book for: " + book.getSymbol());
     }
     if (myQuietModeLevel < 1)
     {
         Console.WriteLine ("    ID/NUM         TIME      SIZE   PRICE");
     }
     prettyPrintEntriesSide (book.getBidLevels(), "BID");
     prettyPrintEntriesSide (book.getAskLevels(), "ASK");
 }
Пример #4
0
            public void prettyPrintLevels(MamdaOrderBook book)
            {
                IEnumerator bidEnum    = book.getBidLevels().GetEnumerator();
                IEnumerator askEnum    = book.getAskLevels().GetEnumerator();
                bool        bidHasNext = bidEnum.MoveNext();
                bool        askHasNext = askEnum.MoveNext();

                if (myQuietModeLevel < 2)
                {
                    Console.WriteLine("Book for: " + book.getSymbol());
                }
                if (myQuietModeLevel < 1)
                {
                    Console.WriteLine("        Time     Num  Size      Price      Act | Act     Price   Size    Num       Time  ");
                }

                while (bidHasNext || askHasNext)
                {
                    if (bidHasNext)
                    {
                        MamdaOrderBookPriceLevel bidLevel = (MamdaOrderBookPriceLevel)bidEnum.Current;
                        if (myQuietModeLevel < 1)
                        {
                            Console.Write("   ");
                            paddedPrint(bidLevel.getTime().ToString("hh:mm:ss.FFF"), 12, false);
                            paddedPrint(bidLevel.getNumEntries(), 4, false);
                            paddedPrint(bidLevel.getSize(), 7, false);
                            paddedPrintPrice(bidLevel.getPrice(), 12, false);
                            Console.Write(" ");
                            paddedPrint(bidLevel.getAction(), 7, false);
                            Console.Write(" ");
                        }
                        bidHasNext = bidEnum.MoveNext();
                    }
                    else
                    {
                        if (myQuietModeLevel < 1)
                        {
                            Console.Write("                                               ");
                        }
                    }
                    if (myQuietModeLevel < 1)
                    {
                        Console.Write("|");
                    }

                    if (askHasNext)
                    {
                        MamdaOrderBookPriceLevel askLevel = (MamdaOrderBookPriceLevel)askEnum.Current;
                        if (myQuietModeLevel < 1)
                        {
                            Console.Write("  ");
                            Console.Write(askLevel.getAction());
                            Console.Write("  ");
                            paddedPrintPrice(askLevel.getPrice(), 12, true);
                            Console.Write(" ");
                            paddedPrint(askLevel.getSize(), 7, true);
                            Console.Write(" ");
                            paddedPrint(askLevel.getNumEntries(), 6, true);
                            Console.Write(" ");
                            paddedPrint(askLevel.getTime().ToString("hh:mm:ss.FFF"), 12, true);
                        }
                        askHasNext = askEnum.MoveNext();
                    }
                    if (myQuietModeLevel < 1)
                    {
                        Console.WriteLine("");
                    }
                }
                if (myQuietModeLevel < 1)
                {
                    Console.WriteLine("");
                }
            }