I got a problem with submitting a stoploss for a new position after exiting a position with multiple entries.
However, this only happens, if the position(s) of one direction get closed at the same time the position of the other direction gets opened. Also, if I limit the numbers of entries per direction to 1, everything works fine.
I think the problem is, because as long as the direction is - for example - short, a ShortStopLimit order is pending at the same level of the StopLoss set for the next position after changing the direction. As soon as the direction changes, this ShortStopLimit order gets cancelled, thus also cancelling the StopLoss order.
Is there a possibility to avoid the cancellation of the StopLoss order?
If requested, I can provide you the code by e-mail for further hints.
Regards,
Sepp
Comment