Very fast indeed, Excellent work! Thanks for sharing! I always use OrderCloseBy or MultipleCloseBy for closing positions. One suggestion: The algorithm sorts the "buy" and "sell" positions by lot size first; if Net position is positive or ...