/// Called on each bar update event (incoming tick) protected override void OnBarUpdate() { if (Historical) { return; } TicksPerSecond.Set(quote_count); quote_count = 0; /* * if(DateTime.Now.Second != the_last_second) * { * if(tick_max < tick_count) * { * tick_max = tick_count; * } * * tick_count = 0; * the_last_second = DateTime.Now.Second; * } * * tick_count++; * * */ }
/// Called on each bar update event (incoming tick) protected override void OnBarUpdate() { if (Historical) { return; } if (FirstTickOfBar) { tick_max = 0; } if (DateTime.Now.Second != the_last_second) { if (tick_max < tick_count) { tick_max = tick_count; } tick_count = 0; the_last_second = DateTime.Now.Second; } tick_count++; TicksPerSecond.Set(tick_max); }