Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose = False + BarsInProgress

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

    CalculateOnBarClose = False + BarsInProgress

    Hi,

    I'm running an automated strategy which uses the CalculateOnBarClose = False on a 1-min timeframe.

    But I would like to add a 60-min timeframe to the script and have a check performed on this 60-min bar at the close of this bar.

    How would I go about to accomplish this? Because I use the calculateonbarclose = false I have no idea how to wait for a second timeseries close.

    Thanks!

    #2
    As long as your strategy is set to COBC = False, you will not know whether the current tick of your bar is the last tick, as it is well possible that it is followed by another tick before the bar closes. Therefore you only know that a bar has closed with the first incoming tick of the next bar.

    Therefore you should check the value of the 60 min bar when you detect the first tick of the next 60 min bar. You can then use that value as needed.

    Comment


      #3
      Hello Harry,

      Thanks for your reply. So how would I go about checking for the first tick of the next 60min bar then?

      Comment


        #4
        Originally posted by siroki View Post
        Hello Harry,

        Thanks for your reply. So how would I go about checking for the first tick of the next 60min bar then?
        You would wait until BarsInProgress == 1 (secondary bar series) and FirstTickOfBar comes true. Then you would retrieve the value for the prior bar of the secondary bar series.

        Comment


          #5
          Hello siroki,

          Thank you for your post and thank you to Harry for his assistance on this thread.

          Harry is correct, you can find information on FirstTickOfBar at the following link: http://www.ninjatrader.com/support/h...ttickofbar.htm
          And BarsInProgress at the following link: http://www.ninjatrader.com/support/h...inprogress.htm

          Please let me know if you have any questions.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          579 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
          554 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