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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        60 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        148 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        98 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X