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 MacDad, 02-25-2024, 11:48 PM
        7 responses
        157 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        6 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Today, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        151 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Started by mattbsea, Today, 05:44 PM
        0 responses
        6 views
        0 likes
        Last Post mattbsea  
        Working...
        X