Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Unmanaged Orders -Setting order to null verses canceling it
Collapse
X
-
Hello Cowpux,
Setting the variable to null, causes the variable to no longer hold the IOrder object. This does not cancel the order, or cause the IOrder object that was once held to be changed at all, it simply removes the IOrder object from the variable and replaces this with a null value.
Calling CancelOrder() causes NinjaTrader to send a cancellation request to the brokerage so that the order is cancelled on their end. When calling this, it does not remove the IOrder object from the variable. This means the order will still be attached to the variable but the IOrder will have the OrderState equal to OrderState.Cancelled.
Setting the variable to null after an order is cancelled or rejected allows for you to detect this in the script when placing a new order. This is more of a coding style than required though.Chelsea B.NinjaTrader Customer Service
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
160 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
308 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
245 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
349 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
178 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment