Im using if(ToTime(Time[0]) == 22000) on 5 min bars to check for the end of day and then cancel any orders but for some reason it never gets processed, ie never true, does any one know why this is ?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
if(ToTime(Time[0]) == 22000) not never true
Collapse
X
-
if(ToTime(Time[0]) == 22000) not never true
Hi,
Im using if(ToTime(Time[0]) == 22000) on 5 min bars to check for the end of day and then cancel any orders but for some reason it never gets processed, ie never true, does any one know why this is ?Tags: None
-
-
The time that you have specified is 2:20 AM local time in the morning. Is that what you intended?Originally posted by GKonheiser View PostHi,
Im using if(ToTime(Time[0]) == 22000) on 5 min bars to check for the end of day and then cancel any orders but for some reason it never gets processed, ie never true, does any one know why this is ?
Comment
-
GKonheiser,
Additionally, with the COBC set to true you would have to wait til the end of the 22000 bar to close before it will be process and calculated. This comes to the issue that the last tick of the bar is the first tick of the next bar. Since. this is the session close that bar will not be officially closed til the open of the next day.Cal H.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Cal View PostGKonheiser,
Additionally, with the COBC set to true you would have to wait til the end of the 22000 bar to close before it will be process and calculated. This comes to the issue that the last tick of the bar is the first tick of the next bar. Since. this is the session close that bar will not be officially closed til the open of the next day.
Ah Ok thats a problem, what is the best method then to cancel all orders at the end of the day then?
Comment
-
-
GKonheiser,
You need to add an 0 at the end of that time you are testing.
The format for that is HHMMSS
This is also held on a 24 hour clock system
10pm would be 220000
Additionally. if you are going to the end of the session you can use ExitOnClose to cancel all strategy generated orders and open positions.
http://www.ninjatrader.com/support/h...xitonclose.htmCal H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment