Thanks for your post.
Please see below for a snippet demonstrating how to loop through active windows.
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;
// make sure we found a chart
if (foundChart == null) return;
// make sure the found chart is the owner window
if (foundChart != this.Owner as NinjaTrader.Gui.Chart.Chart) return;
}));
}
