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 futtrader, 04-21-2024, 01:50 AM
        7 responses
        67 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by pibrew, Today, 06:10 PM
        0 responses
        4 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by pibrew, 04-28-2024, 06:37 AM
        2 responses
        17 views
        0 likes
        Last Post pibrew
        by pibrew
         
        Started by Philippe56140, 04-27-2024, 02:35 PM
        7 responses
        56 views
        0 likes
        Last Post kevinenergy  
        Started by arunkumar3, 08-25-2023, 12:40 PM
        3 responses
        169 views
        0 likes
        Last Post Trader2024!  
        Working...
        X