Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ruler tool, Snap Mode (Bar and Price) for the first two points, third free

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

    Ruler tool, Snap Mode (Bar and Price) for the first two points, third free

    Hey guys,

    Is there any line of code in the Ruler Tool that, when modified, makes the first two points always fall on the bar and price (like when Snap Mode (Bar and Price) is enabled) leaving the third free?​
    Thanks

    #2
    Hello refaelcoisa,

    Thanks for your post.

    Please clarify exactly what you mean when you mention a third point when using the Ruler drawing tool. Are you referring to the textBarsAgo and textY arguments for the Draw.Ruler() method?

    The Draw.Ruler() method has two anchor points for the ruler line which are defined by the 'int startBarsAgo', 'double startY', 'int endBarsAgo', and 'double endY' parameters. There is also a third anchor point defined by the 'int textBarsAgo' and 'double textY' parameters to specify where the text is drawn.

    int startBarsAgo sets the number of bars ago (x value) of the 1st anchor point. startY sets the y value of the 1st anchor point.

    int endBarsAgo sets the number of bars ago (x value) of the 2nd anchor point. endY sets the y value of the 2nd anchor point.

    int textBarsAgo sets the number of bars ago (x value) of the 3rd anchor point. And, double textY determines the y values of the 3rd anchor point.

    All of these parameters would need to be defined in your script when calling the Draw.Ruler() method. None of the parameters could be 'free' and would need to be hardcoded into the method.

    The syntax for Draw.Ruler() could be seen below.

    Draw.Ruler(NinjaScriptBase owner, string tag, bool isAutoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, int textBarsAgo, double textY)

    See this help guide page for more information about Draw.Ruler(): https://ninjatrader.com/support/help...draw_ruler.htm

    Please let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hey @NinjaTrader_BrandonH,

      I'm talking about this code:​

      Click image for larger version

Name:	NinjaScript Editor - Drawing Tool - Ruler.png
Views:	156
Size:	53.6 KB
ID:	1228368

      The ruler tool itself and not the method.

      I use the Ruler Tool with the Snap Mode (Bar and Price). But, in this way the Snap is activeted for the three points, and I would like to have the Snap off for the third one because like that I can place the message point anywhere on the chart.
      So I thought that maybe there is a line in this code that I could modify, which would be convenient because I only use snap for this tool.​

      Comment


        #4
        Never mind, I found a solution.
        Thanks for your time.​

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X