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