Consider merging of two opposite and equal positions. The result amount sum is zero so result order has IOrder.State.CLOSED. After that there are three historical orders: a long position, a short one and a result order with zero amount. After getting these orders from history by the getOrdersHistory method one can see the profit of each of these orders is zero.
How can one calculate the profit of such operations from the order history?