Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 fx.practic, 10-15-2013, 12:53 AM
          5 responses
          5,404 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by Shai Samuel, 07-02-2022, 02:46 PM
          4 responses
          95 views
          0 likes
          Last Post Bidder
          by Bidder
           
          Started by DJ888, Yesterday, 10:57 PM
          0 responses
          8 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          159 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Yesterday, 09:29 PM
          0 responses
          8 views
          0 likes
          Last Post Belfortbucks  
          Working...
          X