Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ATR multi-time frame

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

    ATR multi-time frame

    the ATRs return same value when used in multi-time frame, is it an error
    or can I use it this way?

    if (BarsInProgress == 1){
    ATR_s = ATR(ATR_short_term_periods)[
    0];
    Print(ATR_s);
    }
    if (BarsInProgress == 2){
    ATR_l = ATR(ATR_long_term_periods)[
    0];
    Print(
    "----"+ATR_l);
    }

    Thanks
    Last edited by solvmatic; 02-03-2012, 03:09 PM.

    #2
    Hi Solvmatic,

    Yes, ATR will be calculated based on other time frames you've added.

    What are the added series in your script?
    What are the values for these?
    ATR_short_term_periods
    ATR_long_term_periods


    What's some sample output you're seeing based on the above?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3

      privatestring instrName = "ES 03-12";
      privateint kagiPeriodVolume = 100;
      privateint kagiInterval_ATR_short_term = 2;
      privateint kagiInterval_ATR_long_term = 9;
      privateint aTR_short_term_periods = 10;
      privateint aTR_long_term_periods = 10;

      protected
      overridevoid Initialize()
      {
      AddKagi(instrName, PeriodType.Volume, kagiPeriodVolume, kagiInterval_ATR_short_term, ReversalType.Tick, MarketDataType.Last);
      AddKagi(instrName, PeriodType.Volume, kagiPeriodVolume, kagiInterval_ATR_long_term, ReversalType.Tick, MarketDataType.Last);

      }

      protectedoverridevoid OnBarUpdate()
      {
      if (BarsInProgress == 1){
      ATR_s = ATR(ATR_short_term_periods)[
      0];
      Print(ATR_s);
      }
      if (BarsInProgress == 2){
      ATR_l = ATR(ATR_long_term_periods)[
      0];
      Print(
      "----"+ATR_l);
      }
      }
      Last edited by solvmatic; 02-03-2012, 03:39 PM.

      Comment


        #4
        getting these:

        1.14621053700929
        ----1.14621053700929
        1.13890001015883
        ----1.13890001015883
        1.11945500965089
        ----1.11945500965089
        1.12598225916834
        ----1.12598225916834
        1.10718314620992
        ----1.10718314620992
        1.16432398889943
        ----1.16432398889943

        the 2 ticks reversal and 9 ticks reversal kagi series should return different ATR values. right?
        Last edited by solvmatic; 02-03-2012, 03:42 PM.

        Comment


          #5
          Thanks for those details. It would be good to compare what differences you are seeing when you chart these series side by side. Since both charts use the base 100 volume, they could be similar, or have same highs and lows.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            for the secondary and third time frames, I switched them to volume based, and works

            Add(instrName, PeriodType.Volume, 2000);
            Add(instrName, PeriodType.Volume,
            20000);


            Comment


              #7
              I see, then you'l have different base types. Thanks for following up here. Have a great weekend!
              Ryan M.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              578 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 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
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X