if ( (execution.Order.OrderState == OrderState.Cancelled) && (execution.Order.Filled > 0) ) // process new order fill...
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OnExecution() order fill condition
Collapse
X
-
OnExecution() order fill condition
I noticed the following code in one of NinjaTrader's strategy examples (SampleOnOrderUpdate.cs) when testing to see if an order has been filled in OnExecution(). One of the tests were:
Code:Last edited by risingfire; 06-25-2014, 12:40 PM.Tags: None
-
Hello risingfire,
It is possible to cancel an order that has partial filled but not completely filled.
When this happens you may want to detect this, and then use the filled amount to manage your position, such as exiting that quantity or creating a stop for that quantity.Chelsea B.NinjaTrader Customer Service
-
Thank you, Chelsea, that is helpful. In these situations, who is doing the cancelling?
For example, would I see this condition if I submit a CancelOrder() but the order was partially filled?
Is there any situation when the brokerage would cancel the order with only a partial fill?
Comment
-
-
Originally posted by risingfire View PostThank you, Chelsea, that is helpful. In these situations, who is doing the cancelling?
For example, would I see this condition if I submit a CancelOrder() but the order was partially filled?
Is there any situation when the brokerage would cancel the order with only a partial fill?
Say you have a large limit order. The market takes off after a partial fill and never returns, so the order cannot be completed. NT will cancel the unfilled order when the next bar opens. Ergo, you have a partial order that gets cancelled.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, Today, 07:05 PM
|
0 responses
4 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:05 PM
|
||
Started by Orion815, 05-02-2024, 08:39 AM
|
2 responses
16 views
0 likes
|
Last Post
by Orion815
Today, 06:24 PM
|
||
Started by suroot, 02-25-2017, 04:43 AM
|
11 responses
2,549 views
0 likes
|
Last Post
by Zilvercat
Today, 05:36 PM
|
||
Started by Rogers101, 05-05-2024, 11:30 AM
|
16 responses
50 views
0 likes
|
Last Post
by Rogers101
Today, 04:44 PM
|
||
Started by ninza33, Today, 12:31 PM
|
2 responses
12 views
0 likes
|
Last Post
by ninza33
Today, 03:52 PM
|
Comment