Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

A tick counter using the ATR - help needed with the code (NT7)

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

    A tick counter using the ATR - help needed with the code (NT7)

    I hope you have a beautiful Easter​!

    I am stuck and hope someone can help me. What I am trying to have the indicator do is to show the number of ticks to a target line which is drawn using the ATR. This is for NT7.

    The image shows the output in a 1min chart with a figure of "21465" which is incorrect. The image also shows part of the code I am using and somehow I assume the fault lies in Line 95 but I am not sure which is why I am attaching the indicator in full. (The number of ticks price has moved away from the Opening Line is shown here with "9" which is correct. and needs no fix.)

    I would really appreciate if someone with an eagle eye can spot what I've got wrong and tell me how to fix it.

    sandman



    Attached Files

    #2
    Hello sandman,

    Thanks for your post.

    To understand exactly how the logic in your script is behaving when it is not behaving as expected, you would need to add debugging prints to the script that print out the values being used for your calculations.

    Add prints to the script that print out each of the values you are using to calculate the current price from the target in the script to see how those values are evaluating.

    Prints will appear in Tools > Output window.

    Below is a link to a forum post that demonstrates how to use prints to understand behavior.

    <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
      Thanks Brandon - I'll try that.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      553 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      100 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      543 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      546 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X