We tested your strategy. In all cases when the order close was called, the close amount matched the order total amount, so consequently full position was closed. We also verified that partial close works - by passing only half of the amount to the
OrderClose.
Could you please provide a precise case when full close happens instead of a partial close? Please do compare beforehand what is the total amount of the order and what is the close amount.
If you wish to do the partial close in JForex API approach, consider the following snippet:
//partial close all filled orders with half of their amount
for(IOrder order : engine.getOrders()){
if(order.getState() == IOrder.State.FILLED){
order.close(order.getAmount() / 2.0);
}
}
See more in JForex wiki:
https://www.dukascopy.com/wiki/index.php ... ose_Orders