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 yertle, Yesterday, 08:38 AM
      7 responses
      28 views
      0 likes
      Last Post yertle
      by yertle
       
      Started by bmartz, 03-12-2024, 06:12 AM
      2 responses
      21 views
      0 likes
      Last Post bmartz
      by bmartz
       
      Started by funk10101, Today, 12:02 AM
      0 responses
      4 views
      0 likes
      Last Post funk10101  
      Started by gravdigaz6, Yesterday, 11:40 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by MarianApalaghiei, Yesterday, 10:49 PM
      3 responses
      10 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X