Currently when I select the grey instrument box in top left corner of chart, make instrument change, EventArgs does work for me. However, when I simply type the instrument symbol inside a chart window which brings up a small change instrument box and hit enter >> EventArgs does not work with this action.
I will need to either disable the easy instrument change or figure out how to get EventArgs for the easy instrument change.
Here is my code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NinjaTrader.Gui.Tools.InstrumentSelector _cc_Instrument_Selector;
...
_cc_Instrument_Selector = Window.GetWindow( _myChart.ActiveChartControl.Parent).FindFirst("Cha rtWindowInstrumentSelector") as NinjaTrader.Gui.Tools.InstrumentSelector;
if (_cc_Instrument_Selector != null)
_cc_Instrument_Selector.InstrumentChanged += _OnInstrumentChanged;
...
private void _OnInstrumentChanged(object sender, EventArgs e)
{
var CC_Instrument = _cc_Instrument_Selector.Instrument;
addon.Print(String.Format("OnInstrumentChanged(2) >>> CC_Instrument = {0}", CC_Instrument));
MyCustomActions();
}
...
_cc_Instrument_Selector.InstrumentChanged -= _OnInstrumentChanged;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Really appreciate any help at all on this
Kind Regards
Comment