Thanks for your post.
There is not a supported means to identify when the workspace has finished loading. The workspace will load all charts/windows and also load all other indicators. We do not offer a documented event to identify when this has completed.
You could consider checking when individual scripts have loaded when they have reached State.Realtime, however. For example, you could try looping through all windows, and checking the State of all indicators to see that they have reached this state, which may attain your goal.
Something like the following:
foreach (var window in NinjaTrader.Core.Globals.AllWindows) { //check if the found window is a Chart window, if not continue looking if (!(window is NinjaTrader.Gui.Chart.Chart)) continue; window.Dispatcher.InvokeAsync(new Action(() => { //try to cast as a Chart, if it fails it will be null var foundChart = window as NinjaTrader.Gui.Chart.Chart; if (foundChart == null) return; foreach ( IndicatorBase indi in foundChart.ActiveChartControl.Indicators) Print(indi.Name + " " + indi.State); })); }
Leave a comment: