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

Current Select drawing object

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

    Current Select drawing object

    Hello,
    I've created an indicator using the fantastic toolbar addin from the WFP thread
    https://ninjatrader.com/support/foru...10#post1124507
    The indicator has a drop down menu of colors that I want to click on to change the color of the last selected drawing.
    I have searched everywhere to try and find out how to know what the "current selected" object? Once I have that, then I can change the properties of that object via the button.

    Is there any code that checks what drawing object is selected?

    Hope this makes sense?
    Last edited by rcrook23; 08-04-2021, 06:12 AM.

    #2
    Just realized this should be under NinjaTrader 8 not 7, possible to move it there?

    Comment


      #3
      Hi rcrook, thanks for posting.

      The click method for the WPF sample script lets you update the selection:
      protected void NTBarMenu_Click(object sender, RoutedEventArgs eventArgs)

      In that method you can check if SubItem1 or SubItem2 was selected.

      Kind regards,
      -ChrisL
      Chris L.NinjaTrader Customer Service

      Comment


        #4
        Thanks Chris,
        But how does the NTBarMenu_Click know what drawing object to change? The NTBarMenu_Click works on changing the color of the Print massage bottom left but how can I find the current selected drawing object and then click the menu item to change the drawing properties? I know each drawing object has a unique tag, can this be found on the selected item or is there another property of selected item?

        Hope this makes sense? I'm happy to upload the indicator?

        Comment


          #5
          Hi rcrook23, thanks for your reply.

          NinjaTrader 7 does not use WPF technology, it uses WinForms. Could you upload a reduced sample that demonstrates the issue you are seeing?

          I look forward to hearing from you.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            This is for NinjaTrader8

            Comment


              #7
              hi, I found an indicator that does a FindSelectedDrawObject, so I can now get the selected object. For anyone's ref I have attached.


              Attached Files

              Comment


                #8
                Hi rcrook, sorry, I misread post #2. I'm glad you were able to find a script that resolves.

                Best regards,
                -ChrisL
                Chris L.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by RaddiFX, Yesterday, 11:57 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Marco  
                Started by Tonofit, Today, 12:00 AM
                0 responses
                2 views
                0 likes
                Last Post Tonofit
                by Tonofit
                 
                Started by ck6libra, Yesterday, 11:20 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Manfred  
                Started by witipica, Yesterday, 10:02 PM
                1 response
                14 views
                0 likes
                Last Post NinjaTrader_ChrisSch  
                Started by rtwave, Yesterday, 09:52 PM
                0 responses
                8 views
                0 likes
                Last Post rtwave
                by rtwave
                 
                Working...
                X