Exemple #1
0
        private void dump(TextWriter writer, MamdaOrderBookPriceLevel level, int index)
        {
            string title = level.getSide() == MamdaOrderBookPriceLevel.Sides.Ask ? "Ask" : "Bid";

            writer.WriteLine("{0} {1} | price={2} size={3} action={4} entries={5} time={6}",
                             title,
                             index,
                             level.getPrice(),
                             level.getSize(),
                             level.getAction(),
                             level.getNumEntries(),
                             level.hasTime() ? level.getTime().ToString() : "null");

            foreach (MamdaOrderBookEntry entry in level)
            {
                writer.WriteLine("      |    id={0} size={1} action={2} time={3}",
                                 entry.getId(),
                                 entry.getSize(),
                                 entry.getAction(),
                                 entry.hasTime() ? entry.getTime().ToString() : "null");
            }
        }
Exemple #2
0
        private void deepCopy(IEnumerable bookLevels)
        {
            foreach (MamdaOrderBookPriceLevel bookLevel in bookLevels)
            {
                MamdaOrderBookPriceLevel level = new MamdaOrderBookPriceLevel();
                level.copy(bookLevel);
                switch (level.getAction())
                {
                case MamdaOrderBookPriceLevel.Actions.Add:
                    addLevel(level);
                    break;

                case MamdaOrderBookPriceLevel.Actions.Update:
                    updateLevel(level);
                    break;

                case MamdaOrderBookPriceLevel.Actions.Delete:
                    deleteLevel(level);
                    break;
                }
            }
        }
        private void dump(TextWriter writer, MamdaOrderBookPriceLevel level, int index)
        {
            string title = level.getSide() == MamdaOrderBookPriceLevel.Sides.Ask ? "Ask" : "Bid";
            writer.WriteLine("{0} {1} | price={2} size={3} action={4} entries={5} time={6}",
                title,
                index,
                level.getPrice(),
                level.getSize(),
                level.getAction(),
                level.getNumEntries(),
                level.hasTime() ? level.getTime().ToString() : "null");

            foreach (MamdaOrderBookEntry entry in level)
            {
                writer.WriteLine("      |    id={0} size={1} action={2} time={3}",
                    entry.getId(),
                    entry.getSize(),
                    entry.getAction(),
                    entry.hasTime() ? entry.getTime().ToString() : "null");
            }
        }
 private void deepCopy(IEnumerable bookLevels)
 {
     foreach (MamdaOrderBookPriceLevel bookLevel in bookLevels)
     {
         MamdaOrderBookPriceLevel level = new MamdaOrderBookPriceLevel();
         level.copy(bookLevel);
         switch (level.getAction())
         {
             case MamdaOrderBookPriceLevel.Actions.Add:
                 addLevel(level);
                 break;
             case MamdaOrderBookPriceLevel.Actions.Update:
                 updateLevel(level);
                 break;
             case MamdaOrderBookPriceLevel.Actions.Delete:
                 deleteLevel(level);
                 break;
         }
     }
 }