Thanks for your notes.
In the screenshot you shared on post # 13 I see that your ExitLongLimit() order is using a variable called "Qty" but I do not see where you are defining this value.
Instead of using "Qty", I suggest using the sumFilled amount for the exit orders as seen in the reference sample on the forum thread linked below.
Comment