How do I find the Instrument that is selected for the Chart/Chart Trader?
I figured out how to find the selected account for Chart Trader. Using the same approached I can not find the instrument.
AccountSelector accountSelector = Window.GetWindow(ChartControl.Parent).FindFirst("ChartTraderControlAccountSelector") as AccountSelector;
Print(accountSelector.SelectedAccount.ToString());
InstrumentSelector instrumentSelector = Window.GetWindow(ChartControl.Parent).FindFirst("ChartTraderControlInstrumentSelector") as InstrumentSelector;
Print("insturment: " + instrumentSelector.Instrument.ToString());

Comment