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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      128 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      74 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      116 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      110 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      89 views
      0 likes
      Last Post CarlTrading  
      Working...
      X