Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Value of Time[0]

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

    Value of Time[0]

    In my strategy, I am referencing the value of Time[0] in the OnExecution event. The value it returns is not a bar time stamp on my chart.

    In my case, I am using a 3 minute chart. The Bar Time stamps on the chart are 11:00, 11:03. 11:06, etc. An OnExecution event fired at 11:21:30. The active bar was time stamped 11:24 per my chart, but Time[0] returned 11:22 during the OnExecution event. I expected 11:24, not 11:22. 11:22 is not on an even 3-minute boundary.

    Any ideas??

    #2
    Hello Elevator2TheTop,

    Thank you for your post.

    Are you using multiple data series for the strategy?

    The reason I ask this is, that with Time[0] in OnExecution() it will return the last closed bar from the last BarsInProgress that was called.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Cal View Post
      Hello Elevator2TheTop,

      Thank you for your post.

      Are you using multiple data series for the strategy?

      The reason I ask this is, that with Time[0] in OnExecution() it will return the last closed bar from the last BarsInProgress that was called.
      If I am using multiple data series, it is unintentional. Not even sure how to do that. How can I confirm one way or the other?

      Comment


        #4
        Elevator2TheTop,

        You would see Add(PeriodType, period value); in the initialize section of the script

        Can you share your Initialize section?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          I see the problem. Even though my chart is on a three-minute bar interval, the strategy is configured to 1 (apparently the default). I have corrected the setting, and now Time[0] is reporting the correct timestamp.

          Thank you for your assistance!.

          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