ποΈ Cancel All Pending Orders (Alias)ΒΆ
Alias method: cancels all pending orders. Identical to
closeAllPending()- provided for semantic clarity.
API Information:
- Sugar method:
MT5Sugar.cancelAll(String symbol, Boolean isBuy) - Underlying methods:
closeAllPending()- internally calls closeAllPending()- Source: MT5Sugar convenience layer
π½ InputΒΆ
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol |
String |
βͺ | Symbol name (null = all symbols) |
isBuy |
Boolean |
βͺ | true=BUY orders, false=SELL orders, null=all |
β¬οΈ OutputΒΆ
Returns: int - Number of pending orders successfully cancelled
Throws: ApiExceptionMT5 if operation fails
π¬ Just the essentialsΒΆ
- What it is. Semantic alias for closeAllPending() - "cancel" is clearer than "close" for orders.
- Identical to:
closeAllPending(symbol, isBuy) - Use case. When you want clearer naming (cancel orders vs close positions).
π Usage ExamplesΒΆ
1) Cancel all pending ordersΒΆ
int cancelled = sugar.cancelAll("EURUSD", null);
System.out.printf("β
Cancelled %d pending orders%n", cancelled);
See alsoΒΆ
- Actual implementation:
closeAllPending() - Close positions:
closeAllPositions()