I've been running an automated strategy across multiple markets for quite some time and today for the first time I encountered the following issue: a trading signal triggered an automated entry, but rather than executing I got the following error message: AtmStrategyId parameter 'testStrategyIdValue' already used.
The relevant code snippet from my strategy looks as follows:
if(!orderPlacedLong && my criteria here)
{
orderId = GetAtmStrategyUniqueId();
AtmStrategyCreate(Cbi.OrderAction.Buy, OrderType.StopLimit,High[0]+1*TickSize,High[0]+1*TickSize, TimeInForce.Day, orderId, "MyStrat", "testStrategyIdValue");
orderPlacedLong = true;
}
else if (orderPlacedLong == true && High[0] <= High[1])
{
AtmStrategyCancelEntryOrder(orderId);
orderPlacedLong = false;
}
Any pointers as to what might have happened here would be much appreciated.
Thanks
Comment