Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why does the last bar of a session get closed on the next session open?

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

    Why does the last bar of a session get closed on the next session open?

    Why does the last bar of a session get closed on the next session open? It seems more logical for it to close at the end of the session.

    #2
    Hello cunparis,

    Unfortunately the last bar will only be closed until the next bar is created.

    This is by design.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jason View Post
      Hello cunparis,

      Unfortunately the last bar will only be closed until the next bar is created.

      This is by design.
      I realize that it is intended to be that way, I'm just curious to know the reasoning behind it as I find it unintuitive.

      I had a strategy that I had "wait until flat" set to true and I ran it and it was showing a P/L in real time because it would have had an open position.. it kept showing the open profit until the next day. It seems it didn't do the exit on close. And that got me wondering why the bars are closed the following day.

      Comment


        #4
        "Wait until flat" means no real orders will be placed. The PnL you are seeing is the virtual strategy position PnL. It will remain there until it gets closed out by the strategy.

        "Exit on Close" works off of your session definitions. If you are on a 24 hour chart there is no exit till midnight. If you have no data at midnight, well, then there is no way to exit. I suggest you adjust your chart session definitions. I suggest you use TraceOrders = true to truly isolate out what is going on with your ExitOnClose order.

        Bars are closed when the next bar opens. If you have no data till the next day then it will take till the next day to close the previous bar.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          "Wait until flat" means no real orders will be placed. The PnL you are seeing is the virtual strategy position PnL. It will remain there until it gets closed out by the strategy.

          "Exit on Close" works off of your session definitions. If you are on a 24 hour chart there is no exit till midnight. If you have no data at midnight, well, then there is no way to exit. I suggest you adjust your chart session definitions. I suggest you use TraceOrders = true to truly isolate out what is going on with your ExitOnClose order.

          Bars are closed when the next bar opens. If you have no data till the next day then it will take till the next day to close the previous bar.
          I have my session set to 9:30 - 4:00. If I use exit on close, do they get closed at 3:59:30 or 9:29:30?

          It seems the virtual position in my strategy wasn't closed at 4:00 so I'm wondering what will happen with real money trading.

          Comment


            #6
            cunparis,

            3:59:30. Please use TraceOrders = true to see what was happening. Only then will you know if it was submitted, but too late or some other reason as to what might have caused it not to get filled.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by tkaboris, Today, 08:30 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by styvenrutchell, Yesterday, 12:42 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by ramckay, Yesterday, 08:18 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by asd32, Today, 07:45 AM
            2 responses
            9 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Bruce Lesnar, Yesterday, 10:01 PM
            2 responses
            12 views
            0 likes
            Last Post backtester831  
            Working...
            X