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 sjsj2732, 03-23-2026, 04:31 AM
              0 responses
              42 views
              0 likes
              Last Post sjsj2732  
              Started by NullPointStrategies, 03-13-2026, 05:17 AM
              0 responses
              295 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              290 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              135 views
              1 like
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              98 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Working...
              X