This is the actual code in question, it actually works with the stock market data feed and the "CurrentBar" will only be 0 on the very first tick of the day. The stock will continue to have like 1 million more ticks for the rest of the day and then the same scenario if one is following say 100 different stocks during the day!
Code:/// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { if (CurrentBar == 0) { // Initiate our Timer object with an interval of 1000ms (1 second) myTimer.Tick += new EventHandler(TimerEventProcessor); myTimer.Interval = 1000; myTimer.Start(); } }




Reply With Quote