Sometimes when I am exiting (scaling out) two contracts at a time, and I get a partial fill, then full fill, everything works ok. Then at other times, when that scenario happens my new exit order that I try to fire gets ignored. Of course I do not throw the new exit until after fully exiting, then setting order to null (see my OnExecution logic below). I used TrackOrders and it says it is ignored because an existing exit is still in place.
I've studied my log and the log says that I am completely filled on the exit. Why would NT ignore my new exit order?
Here is a snipit from my log. Notice the BuyToCover gets submitted fine, then it partial exits 1 contract fine, then it fully exits fine. So NT knows that I am fully exited with no contracts left right?
--------------------------------------------------------------
9/15/2008 12:25:13 AM,Position,Instrument='ES 09-08' Account='Replay101' Avg price=1231.57857142857 Quantity=9 Market position=Short Operation=Update Currency=Unknown,
9/15/2008 12:25:13 AM,Order,Order='c05a7db10c8e43888ccaa386f51691d0/Replay101' Name='Sell short' New State=Cancelled Instrument='ES 09-08' Action=SellShort Limit price=1232.25 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Order,Order='c05a7db10c8e43888ccaa386f51691d0/Replay101' Name='Sell short' New State=PendingCancel Instrument='ES 09-08' Action=SellShort Limit price=1232.25 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Execution,Execution='30f0c1400a9d41fc885d4acb0b 9da482' Instrument='ES 09-08' Account='Replay101' Exchange=Default Price=1231.75 Quantity=1 Market position=Long Operation=Insert Order='8256a8eaa8784de688484bf5511d96ab' Time='9/5/2008 8:49:24 AM',
9/15/2008 12:25:13 AM,Order,Order='8256a8eaa8784de688484bf5511d96ab/Replay101' Name='Buy to cover' New State=Filled Instrument='ES 09-08' Action=BuyToCover Limit price=1231.75 Stop price=0 Quantity=2 Type=Limit Filled=2 Fill price=1231.75 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Order,Order='c05a7db10c8e43888ccaa386f51691d0/Replay101' Name='Sell short' New State=Working Instrument='ES 09-08' Action=SellShort Limit price=1232.25 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Order,Order='c05a7db10c8e43888ccaa386f51691d0/Replay101' Name='Sell short' New State=Accepted Instrument='ES 09-08' Action=SellShort Limit price=1232.25 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Order,Order='c05a7db10c8e43888ccaa386f51691d0/Replay101' Name='Sell short' New State=PendingSubmit Instrument='ES 09-08' Action=SellShort Limit price=1232.25 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Position,Instrument='ES 09-08' Account='Replay101' Avg price=1231.57857142857 Quantity=10 Market position=Short Operation=Update Currency=Unknown,
9/15/2008 12:25:13 AM,Order,Order='af75f3849cd3412fa65107f763768e24/Replay101' Name='Sell short' New State=Cancelled Instrument='ES 09-08' Action=SellShort Limit price=1232.75 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Order,Order='af75f3849cd3412fa65107f763768e24/Replay101' Name='Sell short' New State=PendingCancel Instrument='ES 09-08' Action=SellShort Limit price=1232.75 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:13 AM,Execution,Execution='8f20bb6ee82b451fb94721cf63 133ee7' Instrument='ES 09-08' Account='Replay101' Exchange=Default Price=1231.75 Quantity=1 Market position=Long Operation=Insert Order='8256a8eaa8784de688484bf5511d96ab' Time='9/5/2008 8:49:23 AM',
9/15/2008 12:25:13 AM,Order,Order='8256a8eaa8784de688484bf5511d96ab/Replay101' Name='Buy to cover' New State=PartFilled Instrument='ES 09-08' Action=BuyToCover Limit price=1231.75 Stop price=0 Quantity=2 Type=Limit Filled=1 Fill price=1231.75 Error=NoError Native error='',
9/15/2008 12:25:12 AM,Order,Order='8256a8eaa8784de688484bf5511d96ab/Replay101' Name='Buy to cover' New State=Working Instrument='ES 09-08' Action=BuyToCover Limit price=1231.75 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:12 AM,Order,Order='8256a8eaa8784de688484bf5511d96ab/Replay101' Name='Buy to cover' New State=Accepted Instrument='ES 09-08' Action=BuyToCover Limit price=1231.75 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
9/15/2008 12:25:12 AM,Order,Order='8256a8eaa8784de688484bf5511d96ab/Replay101' Name='Buy to cover' New State=PendingSubmit Instrument='ES 09-08' Action=BuyToCover Limit price=1231.75 Stop price=0 Quantity=2 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
---------------------------------------------------------------
Here is my OnExecution logic, which shows that I only reset the order to null if I've had a full fill.
----------------------------------------------------------------------
protected override void OnExecution(IExecution execution)
{
Instr1FillPrice = execution.Price;
Instr1FillQty = execution.Quantity;
Instr1AvgPrice = Position.AvgPrice;
ResetLimits = 1;
if (Instr1BuyOrder1 != null && Instr1BuyOrder1.Token == execution.Order.Token)
{
LongCount += execution.Quantity;
Instr1MP += execution.Quantity;
if (Instr1BuyOrder1.Action == Action.BuyToCover && Instr1SellOrder1 != null) CancelOrder(Instr1SellOrder1);
if (execution.Order.OrderState == OrderState.Filled)
{
Instr1BuyOrder1 = null;
Print("Instr1BuyOrder1 = null");
}
}
if (Instr1SellOrder1 != null && Instr1SellOrder1.Token == execution.Order.Token)
{
ShortCount += execution.Quantity;
Instr1MP -= execution.Quantity;
if (Instr1SellOrder1.Action == Action.Sell && Instr1BuyOrder1 != null) CancelOrder(Instr1BuyOrder1);
if (execution.Order.OrderState == OrderState.Filled)
{
Instr1SellOrder1 = null;
Print("Instr1SellOrder = null");
}
}
}
----------------------------------------------------------------------
I have tried everything I can think of to resolve this. Everything about NT is great except 1) you can't cancel a limit exit order, then resubmit it and 2) exit orders are ignored alot. I've read all the posts about terminal exits and you guy's logic on why you won't allow it, but that risk is the traders' and he should be able to handle his order flow from his program logic, without being restricted so much by you guys 'for our protection'.
Please help!
Van
[email protected]

Comment