I'm testing a strategy and having problems when a StopLimit Order isn't filled..
I need to cancel the EntryOrder and I'm using this code.
AtmStrategyCancelEntryOrder(orderId);
But I get this message...
'AtmStrategyCancelEntryOrder' method error: OrderId 'e76fd41fc98b4a508f1ad1373300f87d' does not exist
But when I put some Print statements in the code to print to the output window the OrderId is correct...
This is the details I get once the order is submitted.
MES 03-22 Chart
Limt Buy Price : 4688.75
Stop Buy Price : 4688.25
OrderId : e76fd41fc98b4a508f1ad1373300f87d
and then when my code attempts to CancelEntryOrder I double check OrderId and it's this
MES 03-22 Chart
OrderId : e76fd41fc98b4a508f1ad1373300f87d
'AtmStrategyCancelEntryOrder' method error: Order ID 'e76fd41fc98b4a508f1ad1373300f87d' does not exist
It does it every-time..
PS. I'm using some of the code from SampleATMStrategy. to place the order and manage.
isAtmStrategyCreated = false;
atmStrategyId = GetAtmStrategyUniqueId();
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(OrderAction.Buy, OrderType.StopLimit, limitPrice, stopPrice, TimeInForce.Gtc, orderId, "AtmStrategyTemplate", atmStrategyId, (atmCallbackErrorCode, atmCallBackId) =>
{
//check that the atm strategy create did not result in error, and that the requested atm strategy matches the id in callback
if (atmCallbackErrorCode == ErrorCode.NoError && atmCallBackId == atmStrategyId)
isAtmStrategyCreated = true;
}
);
This is just part of the code hopefully you will understand...
Thanks..
Comment