![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2012
Posts: 3
Thanks: 3
Thanked 0 times in 0 posts
|
Hi,
Do cancelled OCO orders (i.e. cancelled because the other pair is filled), get routed through OnExecution(). I am finding that OnExecution() is not called for these cancelled orders, but I wanted to double check with you first. Just wanted to mention that I am using unmanaged orders. Thanks.
Last edited by coolguy8; 08-06-2012 at 07:19 PM.
|
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
|
From http://www.ninjatrader.com/support/h...nexecution.htm :
"The OnExecution() method is called on an incoming execution. An execution is another name for a fill of an order." So if there's no fill (ie if the order is cancelled), it seems like OnExecution() won't be called. |
|
|
|
|
The following user says thank you to Radical for this post: |
|
|
|
#3 |
|
Junior Member
Join Date: Jul 2012
Posts: 3
Thanks: 3
Thanked 0 times in 0 posts
|
Thank you very much for your help.
Do you know if there is any way to get a trigger for cancelled orders? I would like to clean up some internal state variables when this occurs. Thanks! |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Sep 2008
Posts: 543
Thanks: 80
Thanked 187 times in 131 posts
|
|
|
|
|
|
The following 2 users say thank you to Radical for this post: |
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,860
Thanks: 163
Thanked 580 times in 571 posts
|
You can check the order state in OnOrderUpdate()
Code:
protected override void OnOrderUpdate(IOrder order)
{
if (order.OrderState == OrderState.Cancelled)
{
// Do stuff
}
Matthew
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Matthew for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unfilled limit orders cancelled | fredb987 | Strategy Development | 3 | 05-23-2012 08:26 AM |
| Cancelled Orders BarsArray | djkiwi | General Programming | 7 | 09-04-2011 05:58 PM |
| MBTrading, Cancelled Orders, and Me | bigfatdrunk | Automated Trading | 3 | 03-31-2011 06:41 AM |
| OCO order automatically cancelled | BillyRayValentine | Strategy Development | 5 | 01-06-2011 09:32 AM |
| orders got cancelled | light7801 | Strategy Development | 6 | 05-04-2010 06:06 AM |