コード例 #1
0
 public static int FillTickRange(DateTime from, DateTime to, string symbol, bool level2)
 {
     _tickList        = new List <Tick>();
     _tickRange       = DivideTicks(_client.QueryQuoteHistoryTicksRange(new DateTime(from.Ticks, DateTimeKind.Utc), new DateTime(to.Ticks, DateTimeKind.Utc), symbol, level2));
     _tickIEnumerator = _tickRange.GetEnumerator();
     return(0);
 }
コード例 #2
0
        static void RequestTicksFiles(QuoteHistoryClient client, DateTime from, DateTime to, string symbol, bool level2, bool verbose)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();

            int count = 0;

            foreach (var tick in client.QueryQuoteHistoryTicksRange(from, to, symbol, level2))
            {
                count++;
                if (verbose)
                {
                    Console.WriteLine(tick);
                }
            }

            long elapsed = sw.ElapsedMilliseconds;

            Console.WriteLine($"Elapsed = {elapsed}ms");
            Console.WriteLine($"Throughput = {((double)count / (double)elapsed) * 1000.0:0.#####} ticks per second");
        }