Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-TimeFrame ATR Not Working

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

    Multi-TimeFrame ATR Not Working

    1. Hey guys, I'm trying to add 5minute ATR to my script but am getting Compiling error: "Only assignment, call, increment, etc...)

    Code:
    Add(PeriodType.Minute, 5)  
    
    //OnBarUpdate
    
    ATR(BarsArray[1], 14)[0];

    2. ALSO. How do I set the Period to Go Back to Beginning of Day. I tried ATR(CurrentBar) didn't work.

    any thoughts?
    Last edited by ginx10k; 02-25-2015, 03:24 AM.

    #2
    ginx10k, having ATR(BarsArray[1], 14)[0]; as statement in OnBarUpdate() as is would not be meaningful, do you have this part of some condition or do you assign it to a variable for example to work later with?

    The # of bars since the session start would be given Bars.BarsSinceSession

    Comment


      #3
      So How do I make it meaningful?

      I'm just trying to print it for now. but getting compiling error. how is this fixed?

      Comment


        #4
        Well, you would need to do something with it, for example the print you mentioned.

        What statement did you exactly try to run for the print command?

        Comment


          #5
          Maybe I stated this wrong. The code
          Code:
          ATR(BarsArray[1], 14)[0];
          is Giving a COMPILING error.

          What do I have to write so that it Compiles properly. if it's a Print statement. what should it look like?

          I tried
          Code:
          Print(ATR(BarsArray[1], 10)[0].ToString);
          I tried
          Code:
          ATR(BarsArray[1], 10)[0];
          I tried
          Code:
          ATR(10, 0)[1];

          HOW DO I MAKE a MultiTimeFrame ATR. if BarsArray is Not the answer, than what is?

          Comment


            #6
            ginx10k, my point simply was this statement alone does not provide any sort of meaning -

            ATR(BarsArray[1], 14)[0];

            I've attached a little example for you that will

            a) print the 5 min ATR
            b) plot the 5 min ATR
            Attached Files

            Comment


              #7
              Got it now. thanks !

              Comment


                #8
                Hi NT Support,

                I'm new to the forum and just finding this post, which is similar to what I'd like to accomplish as well. Do you think it's possible to replicate this is exact logic into a strategy? Meaning, if I have a tick chart and would like to use this MTF data (15 minute) in my strategy, is that possible? (strategy will also be placed on tick chart)

                Comment


                  #9
                  Hello successfulmike,

                  Thank you for writing in.

                  This logic can be replicated from a strategy as well.

                  Do note, however, that you will not be able to add plots to a strategy, so you won't want to use the Add() method on line 32.

                  Please, let us know if we may be of further assistance.
                  Zachary G.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  558 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  324 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  545 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  547 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X