Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Context Menu - shared item

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Context Menu - shared item

    Hello all,
    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

    #2
    Hi Alex, officially those modifications would be unfortunately not supported by us as it's outside of what we call the documented NinjaScript language. However in the following a user custom example was posted for NT7 that should be of help to your 'quest' - https://www.bigmiketrading.com/ninja...enu-items.html

    Comment


      #3
      OK. Thank you. I have resolved it with global shared objects.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      598 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      557 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      555 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X