Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

When do daily bars really update / get 'closed'?

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

    When do daily bars really update / get 'closed'?

    Hi,

    Someone probably has the answer to this one already:

    I have a strategy that calculates on bar close, and is supposed to do something at the close of each daily bar (move a buy stop level to today's close + some number so that it might trigger in a future market session)

    I load up the chart at 7pm and I would think that today, Sep 14th's bar would be considered closed, but the level I'm looking at is still configured based on the day before's close instead of today's.

    However, if I turn calculateonbarclose=false off, the level is correctly set to today's close / or last traded price.

    This is on an equity chart where session manager has set the session to 9:30am-4pm hours.

    This is making me wonder if the bar isn't actually considered closed until the next one has started printing or something - can anyone please verify when the bar is called closed?

    Thanks!

    #2
    Unfortunately, in my experience, calculate on bar close doesnt really 'fire' until the transition to the next bar, and i think this what you are seeing.

    I'd have to run some tests to be sure.

    Hopefully NT support can confirm their event loop logic.

    But in your case it should have fired for sure.

    Sounds like a bug to me.

    Originally posted by RunnrX View Post
    Hi,

    Someone probably has the answer to this one already:

    I have a strategy that calculates on bar close, and is supposed to do something at the close of each daily bar (move a buy stop level to today's close + some number so that it might trigger in a future market session)

    I load up the chart at 7pm and I would think that today, Sep 14th's bar would be considered closed, but the level I'm looking at is still configured based on the day before's close instead of today's.

    However, if I turn calculateonbarclose=false off, the level is correctly set to today's close / or last traded price.

    This is on an equity chart where session manager has set the session to 9:30am-4pm hours.

    This is making me wonder if the bar isn't actually considered closed until the next one has started printing or something - can anyone please verify when the bar is called closed?

    Thanks!

    Comment


      #3
      thanks for adding to the discussion.. yeah, It seems like it doesn't close off the bar until the next one starts from why I've seen, but I thought an NT guy who knew the program's code would be able to say the definite answer.

      In the meantime, I think I've come up with an alternative way to code that will let me keep calulateonbarclose = false and still get my market exit to take place on the morning after a day that has an exit signal, using some kind of "if !Historical && it's before 9:35am and close[1] is lower than exit signal get out now" kind of thing

      Comment


        #4
        yeah, hopefully someone can clarify.

        totime examples




        Originally posted by RunnrX View Post
        thanks for adding to the discussion.. yeah, It seems like it doesn't close off the bar until the next one starts from why I've seen, but I thought an NT guy who knew the program's code would be able to say the definite answer.

        In the meantime, I think I've come up with an alternative way to code that will let me keep calulateonbarclose = false and still get my market exit to take place on the morning after a day that has an exit signal, using some kind of "if !Historical && it's before 9:35am and close[1] is lower than exit signal get out now" kind of thing

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        115 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        161 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        83 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        127 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        87 views
        0 likes
        Last Post PaulMohn  
        Working...
        X