The error message is "GetAtmStrategyStopTargetOrderStatus method error Order name Stop1 is invalid"
The script submits an ATM Strategy
This is the code. . .
string[] entryOrder = GetAtmStrategyEntryOrderStatus(atmStrategyId);
if (entryOrder[2].ToString() == "PartFilled" || entryOrder[2].ToString() == "Filled")
{
for (int i = 1; i <= noOfATMStops; i++)
{
if (al.Count != i)
{
string[,] orders = GetAtmStrategyStopTargetOrderStatus("Stop"+i, atmStrategyId);
if (orders.Length > 0)
{
al.Add(i);
for (int j = 0; j < orders.GetLength(0); j++)
{
AtmStrategyChangeStopTarget(0, stopPrice, "Stop"+i, atmStrategyId);
}
}
}
}
Looking around at other posts they seem to suggest that the error occurs if you use GetAtmStrategyStopTargetOrderStatus before the order is in the right state, but you can see above I check to make sure the order is "Filled", so just seeing if anyone has come across this or can see a problem with what I have done.
Comment