I'm developing a simple add-on following the documentation: https://ninjatrader.com/support/help...t_overview.htm
The add-on I'm developing adds and removes certain drawings object to the chart through ChartControl. Below is a code snippet how I get to chart control
protected override void OnWindowCreated(Window window) { // Instantiate myChart by assigning a reference to the calling Window if (window == null) { return; } myChart = window as Gui.Chart.Chart; if (myChart == null) { return; } chartControl = myChart.ActiveChartControl; if (chartControl == null) { return; } //find chart trader from myChart's Chart Control by its Automation ID: "ChartWindowChartTrader" chartTrader = Window.GetWindow(myChart.ActiveChartControl.Parent).FindFirst("ChartWindowChartTraderControl") as Gui.Chart.ChartTrader; if (chartTrader == null) { return; } ....
To be specific, if there are two chart windows open, one shows AAPL and another GOOG. When trying to log the instrument name from chartControl.Instrument.FullName, the result would be AAPL and AAPL.
Is there a identifier for chart windows that add-on can differentiate between them?
Thanks
Comment