Close All Pending Orders (CloseAllPending)ΒΆ
Alias method: Direct alias for
CancelAll(). Cancels all pending orders with optional filtering.
API Information:
- Extension method:
MT5Service.CloseAllPending(...)(fromMT5ServiceExtensions) - Package: Part of
mt5_term_apilibrary - Region: [11] BULK CONVENIENCE
- Implementation:
=> svc.CancelAll(symbol, isBuy, timeoutSec, ct);
Method SignatureΒΆ
public static Task<int> CloseAllPending(
this MT5Service svc,
string? symbol = null,
bool? isBuy = null,
int timeoutSec = 30,
CancellationToken ct = default)
=> svc.CancelAll(symbol, isBuy, timeoutSec, ct);
π¬ Just the essentialsΒΆ
- What it is: Alias for
CancelAll()- exact same functionality, just a different method name. - Why it exists: Some developers prefer "close" terminology for pending orders instead of "cancel".
- Which to use: Personal preference! Both do exactly the same thing.
π― PurposeΒΆ
Use it for:
- Same purposes as
CancelAll()- see CancelAll.md for full documentation - When you prefer "close" terminology over "cancel"
π Full DocumentationΒΆ
This method is a direct alias for CancelAll(). For complete documentation, including:
- Detailed examples
- Common pitfalls
- Error handling
- Usage scenarios
See: CancelAll.md
π Quick ReferenceΒΆ
// These are IDENTICAL:
int result1 = await svc.CancelAll(symbol: "EURUSD");
int result2 = await svc.CloseAllPending(symbol: "EURUSD");
// Both cancel all pending orders for EURUSD
// Internally, CloseAllPending just calls CancelAll:
public static Task<int> CloseAllPending(...)
=> svc.CancelAll(symbol, isBuy, timeoutSec, ct);
π Related MethodsΒΆ
π Aliases:
CancelAll()- Primary method (this is an alias for it)
π¬ Related Sugar methods:
CloseAllPositions()- Closes MARKET positions (different!)CloseAll()- From Region 06, closes market positions
β οΈ Common PitfallsΒΆ
-
Thinking it's different from CancelAll:
-
Confusing with CloseAllPositions:
π‘ SummaryΒΆ
CloseAllPending is a simple alias for CancelAll():
- β
Exact same functionality as
CancelAll() - β Just a naming preference
- β Use whichever name makes more sense to you
// Both are identical:
await svc.CancelAll(symbol: "EURUSD"); // Option 1
await svc.CloseAllPending(symbol: "EURUSD"); // Option 2
For full documentation, see CancelAll.md π