Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 gbourque, Yesterday, 04:11 PM
        3 responses
        14 views
        0 likes
        Last Post gbourque  
        Started by cshox, Today, 01:07 PM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by john_44573, Today, 11:43 AM
        2 responses
        8 views
        0 likes
        Last Post john_44573  
        Started by NickyD, 10-26-2023, 04:41 PM
        4 responses
        184 views
        0 likes
        Last Post dodoei
        by dodoei
         
        Started by 2inthebush, 05-03-2022, 05:09 PM
        5 responses
        2,254 views
        0 likes
        Last Post arthourc  
        Working...
        X