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 janio973, Today, 07:24 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by aligator, 01-06-2022, 12:14 PM
      4 responses
      238 views
      0 likes
      Last Post john_44573  
      Started by reynoldsn, Today, 05:56 PM
      0 responses
      12 views
      0 likes
      Last Post reynoldsn  
      Started by bortz, 11-06-2023, 08:04 AM
      51 responses
      1,991 views
      0 likes
      Last Post aligator  
      Started by dmking, 11-12-2019, 12:31 PM
      4 responses
      4,155 views
      0 likes
      Last Post jasonw
      by jasonw
       
      Working...
      X