see the test code:
protected override void OnBarUpdate() { var curThreadId = Thread.CurrentThread.ManagedThreadId; var dispatcherThreadId = this.Dispatcher.Thread.ManagedThreadId; var isInUIThread = (curThreadId == dispatcherThreadId); Log(string.Format("Thread{1}: I am {0}in UI thread. CurrentBar={2}, Count={3}", isInUIThread ? "" : "NOT ", curThreadId, this.CurrentBar, this.Count), LogLevel.Error); }
If replace Log() with Print(), the order is correct:
By the way, I checked the log file under my document\ninjatrader8 path, the order is correct. So I guess it's the Log Tab's bug to show items withou sync with the log file.
Comment