Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    BertrandNinjaTrader Customer Service

    Comment


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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by zstheorist, Today, 07:52 PM
      0 responses
      3 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      149 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Working...
      X