The order merging logic currently is not located in API, so there is no way you can obtain data of the resulting order without actually merging a set of orders by calling the IEngine.mergeOrders method.
While only the resulting order amount is concerned, the order merging algorithm is rather straightforward:
[SELL,0.2] + [BUY, 0.5] = [BUY, 0.3];
[SELL,0.2] + [SELL, 0.4] + [BUY, 0.5] = [SELL, 0.1]
[SELL,0.2] + [SELL, 0.3] + [BUY, 0.5] = [] (the merged order doesn't get created since the resulting amount is 0)
However, the price calculation algorithm is more evolved.
Also see order merging preconditions:
https://www.dukascopy.com/wiki/index.php ... _Positions