I need to add an item to chart context menu of NinjaTrader. I know the way how to do that, but I have two different indicators and I need them to "share" the same menu item.
For example:
first indicator look at context menu items and try to find menu item "TEST". If it is not found it creates new one with text "TEST" and then add some subitems.
The second inidcator do the same, if it try to find "TEST" item, it is successfull and skip code for creating new one..just add some subitems to TEST item.
Of course it depends on indicator order, but if both indicators uses the same logic I think this idea is correct.
I dont know how to do that because when I try to find existing item within OnStartUp event, it answers always NOT FOUND I try to use:
this.ChartControl.ContextMenuStrip.Items.Find("TES T") ...array is empty
this.ChartControl.ContextMenuStrip.Items.ContainsK ey("TEST")....return false
this.ChartControl.ContextMenuStrip.Items.IndexOfKe y...return -1
I tried to do that witin OnBarUpdate in first pass - the same result.
Could you be so kind and help me ??
Thank you.
Alex
Comment