Пример #1
0
        private void PrintSnapshot <TE>(IDxEventBuf <TE> buf)
        {
            var symbolStr = buf.Symbol;

            if (buf.EventType == EventType.Candle)
            {
                var candleSymbol = CandleSymbol.ValueOf(symbolStr);
                if (candleSymbol.IsDefault())
                {
                    symbolStr = candleSymbol.ToFullString();
                }
            }

            Console.WriteLine("Snapshot {0} {{Symbol: '{1}', RecordsCount: {2}}}", buf.EventType, symbolStr, buf.Size);
            var count = 0;

            foreach (var o in buf)
            {
                Console.WriteLine("   {{ {0} }}", o);
                if (++count < recordsPrintLimit || recordsPrintLimit == 0)
                {
                    continue;
                }

                Console.WriteLine("   {{ ... {0} records left ...}}", buf.Size - count);

                break;
            }
        }