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

Add MenuItem within MenuItem in ContextMenu

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

    Add MenuItem within MenuItem in ContextMenu

    Hi,

    for my indicator I would like to modify the context menu which appears when right-clicking on the chart. Specifically, in the context menu I need to implement a MenuItem with header "MyIndicator" and within it I would like to have a number of child menu items with headers like "Action 1", "Action 2", etc.

    To give you an idea I would like to obtain something like is already there for the Crosshair entry, which within it shows other menuitems.

    In general I know how to add a menu item to the context menu, there are lot of examples in the forum. But I would highly appreciate if you could provide support on this specific question for which I have not found any resource.

    Thank you so much in advance!



    #2
    Hello VFI26,

    Please note, modifying the right-click context menu is not documented and not officially supported by NinjaTrader Support.
    There can be limitations using unsupported code and advanced C# concepts in a NinjaScript, so your mileage may vary.

    I don't have an indicator resource I can provide, however, there is a drawing tool using unsupported code that modifies the context menu you may find helpful.
    Hi, I'm developing an Indicator which updates a boolean variable in a custom Drawing Tool. The problem is: the drawing tool is attached to a symbol in all time


    Also, I can provide a link to an addon that modifies the right-click context menu.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      thank you for your answer!! How can I run these addons? For the time being I have experience with indicators development only, not addons.

      Thank you in advance!

      Comment


        #4
        Hello VFI26,

        To import a NinjaScript into NinjaTrader 8 do the following:
        1. Download the script to your desktop, keep it in the compressed .zip file.
        2. From the Control Center window select Tools -> Import -> NinjaScript...
        3. Click the Desktop icon on the left to navigate to the desktop
        4. Select the downloaded .zip file -> then click Open
        5. NinjaTrader will then confirm if the import has been successful.
        Critical *Note that on any files that say "File already exists on your PC" that start with an "@" symbol are the ones that came preloaded inside of NinjaTrader so you would say "No" so that you do not override those files.

        Below is a link to the help guide on importing NinjaScripts.
        https://ninjatrader.com/support/help...-us/import.htm

        The DrawingToolContextMenuExample drawing tool can be added to a chart by clicking the drawing tool menu on the chart titlebar and selecting DrawingToolContextMenuExample.

        The ContextMenuAddonExample can be opened from the Control Center -> New menu.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Chelsea,

          thank you again for you support! I was able to import the AddOn. Actually what I see is


          Click image for larger version

Name:	image.png
Views:	120
Size:	8.5 KB
ID:	1270695

          So two items are added in the context menu. My question is about how to implement a context menu in a way that Menu Item 1 and Menu Item 2 have other children menu items nested within them which will appear on the right side, something like the Crosshair.

          Click image for larger version

Name:	image.png
Views:	90
Size:	16.7 KB
ID:	1270696

          How can I achieve this? Thank you so much in advance!




          Comment


            #6
            Hello VFI26,

            Unfortunately, I would not have an example of this.

            You may be able to nest a MenuItem inside of a MenuItem.

            This thread will remain open for any community members that would like to provide insight for this unsupported task.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Fitspressorest, Today, 01:38 PM
            0 responses
            2 views
            0 likes
            Last Post Fitspressorest  
            Started by Jonker, Today, 01:19 PM
            0 responses
            2 views
            0 likes
            Last Post Jonker
            by Jonker
             
            Started by futtrader, Today, 01:16 PM
            0 responses
            6 views
            0 likes
            Last Post futtrader  
            Started by Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,791 views
            0 likes
            Last Post aligator  
            Started by Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            844 views
            0 likes
            Last Post emuns
            by emuns
             
            Working...
            X