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 charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          52 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          142 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          160 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 05-10-2026, 08:12 PM
          0 responses
          96 views
          0 likes
          Last Post CarlTrading  
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          276 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Working...
          X