Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose NT7 vs NT6.5

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

    CalculateOnBarClose NT7 vs NT6.5

    I noticed a difference in behavior in the multi-frame strategy processing between NT6.5 and NT7.

    My strategy is using CalculateOnBarClose = true. Two timeframes are used: 1 Minute and 30 Minute. I refer to 1 minute timeframe as Closes[Min1][0] and to 30 minute timeframe as Closes[Min30][0].

    In NT6, when the time is on the half hour (9:30, 10:00, 10:30, etc) and BarInProgress = 1Min, Closes[Min30][0] refers to the close 30 minutes ago. For example, if it's 10:00 AM and I am in the 1Min timeframe, then Closes[Min30][0] refers to the close price at 9:30 AM.

    In NT7, when the time is on the half hour and BarInProgress = 1Min, Closes[Min30][0] refers to the most recent close price. For example, if it's 10:00 AM and I am in the 1min timeframe, then Closes[Min30][0] refers to the close price at 10:00 AM.

    When the time is NOT on the half hour, then Closes[Min30][0] matches between NT7 and NT6.5.

    Is this by design or is it a bug? Which way is correct?

    Thanks.

    Evgueni

    #2
    Evgueni, thanks for reportin in - I'm not aware of expected differences in this regard, are you working with the same session settings / feeds / data to be able to compare the bars?

    Would you mind sharing the script you used to compare so we can test it here on our end?

    Thanks

    Comment


      #3
      I am using TDAmeritrade for both NT7 and NT6.5.

      The way to reproduce is to open the Output window and run the following strategy for any instrument for any 1 day using the 1-minute timeframe.

      using System;
      using NinjaTrader.Data;
      using NinjaTrader.Strategy;

      namespace NinjaTrader.Strategy
      {
      public class MultiFrameDemo : Strategy
      {
      protected override void Initialize()
      {
      this.CalculateOnBarClose = true;
      this.BarsRequired = 0;
      this.Add(PeriodType.Minute, 5);
      }
      protected override void OnBarUpdate()
      {
      if (this.BarsInProgress == 0 && ToTime(Time[0]) >=93000 && ToTime(Time[0]) <=93500)
      {
      Print(String.Format("5 minute price as of {0} is {1}", Time[0], Closes[1][0]));
      }
      }
      }
      }

      Comment


        #4
        Thanks for the details Evgueni, we'll reproduce shortly here and get back to you then. Thanks

        Comment


          #5
          Thank you for your patience, popsovy.

          I notice the same discrepency here.

          Multiseries in 6.5 should be evaluated with the secondary series smaller than the primary series. This is a limitation that has been addressed in version 7.

          Please test with the series reversed: 5 minute primary and 1 minute secondary and let us know if you see similar.
          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
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X