Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily ATR

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

    Daily ATR

    Hello, I'm trying to pull in the daily ATR(14) in my strategy that is running on 4 range chart ... I have this line in my Initialize() section:
    Add(PeriodType.Day, 1);

    And this line in my OnBarUpdate() section:
    if (BarsInProgress == 1 && CurrentBars[1] >= 0)
    {
    DrawTextFixed("ATR",("Daily ATR("+ATR_period+"): "+ (ATR(ATR_period)[0]).ToString("N2")), TextPosition.BottomRight);
    }

    When I run the strategy, I don't get the ATR value ... I know this because the "DrawTextFixed" command doesn't execute. Any thoughts?

    #2
    Hello pman777,

    Please add a print to the action part of this conditional statement, open the output window, and reload the strategy.

    Tools -> Output Window...

    Does the print show in the output window?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply ... yes, I've done that but nothing shows up.

      Comment


        #4
        Hello pman777,

        This means that the conditions are not true.

        Try printing the values of CurrentBars[1] to the output window.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        672 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        379 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        577 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        582 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X