But I also want to make sure that the right Account and ATM are chosen.
I Render a message at the bottom of the chart if either the Account or ATM are not the ones that I want to use. The code I'm using below is working, but I cobbled it together from a few other posts I found.
Is there anything I should change to make it more efficient/correct?
//===== GET CHART TRADER INFO
activeAtm = "NO ATM SELECTED";
if (ChartControl.Properties.ChartTraderVisibility != ChartTraderVisibility.Collapsed)
ChartControl.Dispatcher.InvokeAsync((Action)(() =>
{
xAlselector = Window.GetWindow(ChartControl.Parent).FindFirst("ChartTraderControlAccountSelector") as NinjaTrader.Gui.Tools.AccountSelector;
activeAccount = xAlselector.SelectedAccount.ToString();
if (ChartControl.OwnerChart.ChartTrader.AtmStrategy.Template != null)
activeAtm = ChartControl.OwnerChart.ChartTrader.AtmStrategy.Template.ToString();
}));
chartTraderStatus = ChartControl.Properties.ChartTraderVisibility;
}

Comment