Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Why does the last bar of a session get closed on the next session open?
Collapse
X
-
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.Originally posted by NinjaTrader_Jason View PostHello cunparis,
Unfortunately the last bar will only be closed until the next bar is created.
This is by design.
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
-
"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
-
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?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.
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Today, 05:17 AM
|
0 responses
50 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
126 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
69 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
42 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
46 views
0 likes
|
Last Post
|

Comment