• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying the Line Tool

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

    Modifying the Line Tool

    Hey there,

    I would like to Modify the Line tool so that if I hold shift when I draw a line, it will restrict it to horizontal... I don't want it to span the whole screen like the built-in horizontal line.

    Is this possible?

    Thanks,

    Kev

    #2
    Hello reach4thelasers,

    Thank you for your post.

    You could create a custom drawing tool that was the same as the Line with this function. You can look into the Lines Drawing Tools code by going to the NinjaTrader Control Center > New > NinjaScript Editor > double click on the Drawing Tools folder > double click on the Lines file.

    For information on Drawing Tools in NinjaScript please visit the following link: http://ninjatrader.com/support/helpG...wing_tools.htm

    Please let me know if you have any questions.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks Patrick found what I needed and its working great.

      I've attached the modified line tool. Hold shift and draw and line and it will snap to horizontal. You should consider adding this change to Trunk its a great feature enhancement.
      Attached Files

      Comment


        #4
        Hello reach4thelasers,

        Thank you for posting your edit.

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by ludopuig
          One question: Is mandatory to create a custom drawing tool, same as the Line plus this function, or is it possible to change the Line code instead?

          Thanks!
          Hello ludopuig,

          Thank you for your response.

          While it would not be recommended, you can in fact edit the Lines.cs file if you wished to do so.

          Please let me know if you have any questions.
          Patrick H.NinjaTrader Customer Service

          Comment


            #6
            Would someone be so kind to code this for NT7?

            Thank You


            Originally posted by reach4thelasers View Post
            Thanks Patrick found what I needed and its working great.

            I've attached the modified line tool. Hold shift and draw and line and it will snap to horizontal. You should consider adding this change to Trunk its a great feature enhancement.

            Comment


              #7
              Hello geotabs,

              Thank you for your response.

              Custom drawing tools through NinjaScript were not supported in NinjaTrader 7.

              Please let me know if you have any questions.
              Patrick H.NinjaTrader Customer Service

              Comment


                #8
                Hello InTheMoment,

                The posted modification applies changes to OnMouseDown. This code is shared between Lines and Rays. If you would like to have this work for while you are first drawing the object, you could move this code in OnMouseMove. Another approach to consider would be to add your own keyboard events and check that the DrawingState is IsEditting on that keyboard event.

                Adding your own Keyboard events would be a general C# approach that would not specifically be NinjaScript.

                Please let us know if we can be of further assistance.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Is there any updates on this? I got this working on my laptop but my install on my desktop it wont work.. I replaced the @Lines.cs file in the bin/custom/drawingtools folder but it still won't snap horizontally when holding shift and drawing a line

                  Comment


                    #10
                    Hello zachiatrist,

                    reach4thelasers has not posted any additional modifications to the script in post #3.

                    We are tracking interest in having similar behavior added to drawing tools so they snap horizontally/vertically when pressing Shift/Control with the ticket ID SFT-2546. I have added a vote on your behalf. We collect interest in feature requests before determining if the feature should be implemented. For that reason we cannot offer an ETA or promise of fulfillment. Upon implementation, the number for the ticket ID can be publicly found in the Release Notes page of the help guide. I will provide a link below.

                    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

                    Please let us know if you have any questions.
                    JimNinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by JBTrader2005, Yesterday, 03:57 PM
                    1 response
                    15 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Started by azstraso, Today, 06:38 AM
                    0 responses
                    1 view
                    0 likes
                    Last Post azstraso  
                    Started by bippo, Today, 06:25 AM
                    0 responses
                    2 views
                    0 likes
                    Last Post bippo
                    by bippo
                     
                    Started by Serge A, Yesterday, 04:03 PM
                    1 response
                    14 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Started by Mykro, Yesterday, 10:03 PM
                    1 response
                    7 views
                    0 likes
                    Last Post NinjaTrader_PaulH  
                    Working...
                    X