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

Selection of custom drawing object

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

    Selection of custom drawing object

    Hello,

    I have a very simple custom drawing tool that draws a line every 100 pts from a set level when you click. You can vary the size by grabbing and anchor and dragging it.

    The issue I am trying to solve. As it draws lines all the way up and down the chart, when you click on the chart, even if you do not click anywhere near the line, NT selects it and you loose the ability to click on the chart and pan it. I've tried sending the draw object to the background, but this makes no difference.

    How do I make NT select the drawing object ONLY if the line is actually clicked on within, say, 10 pixels or so?

    Example gif video below (attached)

    Thanks.
    Attached Files

    #2
    Hello pjsmith,

    Thanks for your post.

    This would require using an indicator and plots to accomplish this.

    The Drawing Tool selection is based on the anchors of the draw objects and the code you write for the mouse handling. This works differently than plots do.

    You could create an indicator that places plots every 100 points and when selecting near the plot, it will select all plots so that you are not relying on anchors.

    AddPlot(): https://ninjatrader.com/support/help...t8/addplot.htm
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi - Thanks - That would be an incredibly bad way to do it All those plots. All those resources. Totally wasted!

      I will try and figure something else out.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by PaulMohn, Today, 02:06 AM
      0 responses
      1 view
      0 likes
      Last Post PaulMohn  
      Started by Mindset, Today, 01:27 AM
      0 responses
      4 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by EB Worx, 03-07-2023, 05:05 AM
      4 responses
      97 views
      1 like
      Last Post cls71
      by cls71
       
      Started by patricia70, 11-23-2020, 10:17 AM
      17 responses
      546 views
      1 like
      Last Post PaulMohn  
      Started by Jltarrau, 04-28-2024, 10:18 PM
      1 response
      14 views
      0 likes
      Last Post brucerobinson  
      Working...
      X