PineHookPineHook

Close Positions Commands

All eight close position commands: their parameters, behavior, error messages, and troubleshooting.

Overview#

Close position commands let you exit open trades from TradingView alerts without touching MetaTrader manually. The platform receives the signal, authenticates it, and delivers it to your EA over the live WebSocket connection. The EA then executes the close on your MT5 terminal at market price with high deviation tolerance. Closes always fill, even during fast markets; slippage is disclosed rather than blocked.

Three design decisions shape every close command: they bypass symbol filters (a disabled symbol still closes), they execute even when a subscription has lapsed (so you're never locked out of exiting a position), and they run regardless of Active Hours (a close sent after the active window has ended still executes).


Command Reference#

CommandClosesSymbolUnique Parameters
closelongBuy (long) positions onlyRequiredclose_pct, close_lots, magic
closeshortSell (short) positions onlyRequiredclose_pct, close_lots, magic
closeallBoth long and shortOptional (omit for kill switch)magic
closecancelallBoth long and short, plus all pending ordersOptional (omit for kill switch)magic
closeallprofitNet-profitable positions only (P&L incl. swap+commission)Optional (omit for kill switch)minprofit, magic
closealllossNet-losing positions only (P&L incl. swap+commission)Optional (omit for kill switch)maxloss, magic
closealleaoffBoth long and short (whole account), then disables EAIgnored — always globalnone (symbol and magic ignored)
closecancelalleaoffBoth long and short, all pending orders (whole account), then disables EAIgnored — always globalnone (symbol and magic ignored)

Kill switch: when a symbol is omitted from any of the optional-symbol commands, the command operates on every position (and every pending order, for cancel variants) on the entire MT5 terminal, including positions opened manually or by other EAs. See the Critical Behaviors section for the full implications.


How It Works#

Group A: Directional closes: closelong and closeshort#

  1. You send a signal with the command, the symbol, and optional partial-close or magic filter parameters.
  2. The platform validates the parameters. If validation fails, the signal is rejected immediately and the rejection reason is recorded in Signal Logs.
  3. If validation passes and the license is authenticated, the platform forwards the signal to the EA over the WebSocket.
  4. The EA searches all open positions for those matching the symbol and direction (buy positions for closelong; sell positions for closeshort).
  5. If a magic filter was supplied, only positions whose magic number matches are included.
  6. For each matching position, the EA calculates the volume to close:
    • With close_pct: the target volume is that percentage of the position's original entry volume, not the current remaining volume. For example, if the original entry was 1.0 lot and the position was already partially closed to 0.5 lot, sending close_pct=50 closes 0.5 lot (50% of the original 1.0 lot). The result is floored to the broker's lot step. If the floored volume equals or exceeds the remaining position size, the EA performs a full close instead.
    • With close_lots: close that exact amount. On a netting account it closes close_lots from the single position (capped at its size). On a hedging account holding several legs on the same symbol/direction/magic, close_lots is a total budget consumed across the legs, not an amount taken from each — e.g. with three 1.0-lot longs, closelong close_lots=0.5 closes 0.5 total (drawn from the legs in turn), not 0.5 from each (1.5). Remaining legs are left untouched once the budget is spent. (close_pct instead applies the percentage to each leg's own size.)
    • No dust positions (both modes): the close volume is always snapped to the symbol's minimum divisible size (volume step). If closing the requested amount would leave a remainder below the broker's minimum lot — too small to ever close on its own — the EA closes the entire position instead, so a partial close never strands an un-closeable "dust" leftover. A close command on a position already below the minimum lot simply closes it in full.
    • With neither: the entire position is closed.
  7. The EA submits the close order with a very large deviation tolerance, ensuring execution in fast markets and around major news events.
  8. After execution, the EA sends an acknowledgement to the platform with the actual fill price and measured slippage in points.
  9. If slippage exceeded the extreme-slippage threshold, the Signal Logs entry for this signal displays an amber "Extreme volatility" pill. The close still succeeded; the pill is informational.
  10. Signal Logs reflects the final status (executed, or partially executed if some closes failed at the broker level).

Deduplication: if the same signal is delivered twice (network retry scenario), the EA detects the duplicate via its execution history and skips the second attempt. A "Duplicate signal" message appears in the MetaTrader Experts tab.

Group B: Full sweeps: closeall and closecancelall#

The flow is identical to Group A with two differences:

Symbol-scoped variant (symbol provided): operates on both long and short positions for that symbol simultaneously. Magic filtering applies in the same way as closelong/closeshort. In Multi-Strategy (multi-magic) mode a symbol-scoped sweep REQUIRES a magic — sent without one it is rejected (it would otherwise flatten every strategy's positions on that symbol). Single mode uses the EA's default magic. The same requirement applies to closeallprofit, closeallloss, and cancelall. The symbol-less variant below stays the deliberate cross-strategy emergency brake and is exempt.

Symbol-less variant (no symbol): the platform converts the signal to a global-sweep instruction. With no magic, the EA closes every open position on the terminal regardless of symbol, magic number, or which EA or trader opened it. An explicit magic is honored even without a symbol: magic=N closes only that strategy's positions across all symbols (a strategy-wide shutdown), magic=0 closes only manual (magic-0) trades, and magic=ALL is the same full sweep as omitting the magic. For closecancelall, after completing all position closes, the EA cancels every pending order matching the same scope. The close and cancel operations share the same symbol and magic filters.

For closecancelall, the ACK reports both the number of positions closed and the number of pending orders cancelled. If either operation only partially succeeded, the Experts tab shows a message in the form "Partial closecancelall: closed X of Y positions, cancelled Z of W orders on SYMBOL".

Group C: Conditional closes: closeallprofit and closeallloss#

These commands add a profitability filter on top of the sweep logic.

closeallprofit: at the moment the signal is processed, the EA classifies each position as a winner or loser by its net profit/loss — the floating (price) P&L plus swap and commission — not by price alone. A position qualifies only if its net P&L is positive. This matters on carry-negative pairs and commission-per-lot (ECN) accounts: a position that is up on price but pushed underwater by overnight swap or commission counts as a loss, so closeallprofit skips it. If minprofit is supplied, the position must also have reached at least that many price pips of favourable movement (minprofit is a separate pip-magnitude filter, not a net-money threshold). Positions at break-even or net-negative are skipped.

closeallloss: same net basis — a position qualifies if its net P&L (floating profit + swap + commission) is negative, so a price-positive position that swap/commission have turned net-negative will be closed. If maxloss is supplied, the position's adverse movement must be at most that many price pips to qualify; positions with a larger pip loss are spared. For example, maxloss=20 closes net-losing positions that are down 0 to 20 price pips, leaving anything down more than 20 pips untouched. A position sitting at exactly net zero is closed by neither command.

Neither command supports partial close (close_pct and close_lots are not valid parameters for these variants). Each matching position is closed in full.

The symbol-less variant of both commands operates across all symbols on the terminal.

Group D: Compound disable commands: closealleaoff and closecancelalleaoff#

These commands are always global — they ignore any symbol or magic you include and flatten the entire account (every symbol, every magic number), exactly like a magic-less symbol-less closeall / closecancelall. After all closes (and cancels, for the cancel variant) are complete, the EA disables itself.

The disable is sticky and persistent: no further entry signals are accepted until you explicitly send eaon,ALL. A symbol-specific eaon, a dashboard settings update, and restarting the EA in MetaTrader will not lift it — the emergency stop is saved to disk and survives a restart. (This is what distinguishes an emergency stop from eaoff,ALL, which is a softer halt that a settings update or restart can clear.)

Use these commands to shut down both trading activity and the EA in a single signal.


Parameters Reference#

ParameterApplies ToTypeConstraintNotes
symbolAll commandsText (1-20 alphanumeric characters)Required for closelong and closeshort; optional for all othersConverted to uppercase. Omitting it on optional-symbol commands activates the kill-switch variant.
close_pctcloselong, closeshortNumberGreater than 0 and up to 100Cannot be combined with close_lots. Percentage of the original entry volume, not remaining volume. Snapped to the symbol's lot step; if the leftover would be below the minimum lot, the EA full-closes instead (no dust).
close_lotscloselong, closeshortNumberGreater than 0, up to 100,000Cannot be combined with close_pct. A fixed volume: on netting, from the single position (capped at its size); on hedging with several legs, a total budget consumed across the legs (close_lots=0.5 over three legs closes 0.5 total, not 1.5). Snapped to the lot step; if the leftover would be below the minimum lot, the EA full-closes that leg instead (no dust). A finite-but-absurd value above the 100,000 ceiling (matching the per-target ladder close_lots) is rejected with HTTP 400.
minprofitcloseallprofitNumber0 or greaterMinimum favourable movement in price pips a position must have to qualify. (Whether a position is a "winner" is decided on net P&L incl. swap+commission; minprofit is a separate pip-magnitude filter.) Omitting it closes all net-profitable positions.
maxlossclosealllossNumber0 or greaterMaximum adverse movement in price pips a position may have to qualify. (Net P&L incl. swap+commission decides "loser"; maxloss caps the pip magnitude.) Omitting it closes all net-losing positions regardless of size.
magicAll commandsIntegerAny valid magic numberRestricts the command to positions (and pending orders, for cancel variants) with this magic number. Behavior in Multi-Strategy mode is described under Critical Behaviors below.

Signal Formats#

CSV format (closelong example):

LICENSE_KEY,closelong,EURUSD
LICENSE_KEY,closelong,EURUSD,close_pct=50
LICENSE_KEY,closelong,EURUSD,close_lots=0.25,magic=12345

JSON format (closelong example):

{"license":"LICENSE_KEY","action":"closelong","symbol":"EURUSD"}
{"license":"LICENSE_KEY","action":"closelong","symbol":"EURUSD","close_pct":50}
{"license":"LICENSE_KEY","action":"closelong","symbol":"EURUSD","close_lots":0.25,"magic":12345}

Symbol-less kill switch (CSV and JSON):

LICENSE_KEY,closeall
{"license":"LICENSE_KEY","action":"closeall"}

LICENSE_KEY,closecancelall
{"license":"LICENSE_KEY","action":"closecancelall"}

Conditional close with filter:

LICENSE_KEY,closeallprofit,EURUSD,minprofit=10
LICENSE_KEY,closeallloss,EURUSD,maxloss=25
{"license":"LICENSE_KEY","action":"closeallprofit","symbol":"EURUSD","minprofit":10}

Critical Behaviors#

Symbol filter bypass. Close commands ignore all symbol filters configured in the dashboard: whitelist, blacklist, and per-symbol eaoff. A position on a disabled symbol still closes. Only entry commands (buy, sell, pending orders) are subject to symbol filtering.

Inactive license bypass. If a subscription has expired or a license is inactive, entry commands are blocked. Close commands are not. You can always exit open trades even without an active subscription.

The "always exit" guarantee is enforced end-to-end. Beyond the inactive-license bypass above, close/cancel commands are also exempt from the two gates that could otherwise drop them: (1) they are never rejected by the per-minute or daily rate limit (a kill-switch can only reduce exposure), and (2) they are never dropped by security throttles, so another account's failed sign-ins can never block your emergency close. A close that genuinely fails to reach the EA is therefore almost always a connectivity issue (EA offline / WebSocket down), not a server-side rejection.

Slippage is disclosed, not blocked. Every close executes with a high deviation tolerance to guarantee fills. If actual slippage exceeded the extreme-slippage threshold, the Signal Logs entry shows an amber "Extreme volatility" pill. The close was successful; the pill is informational only.

Kill-switch scope. When a symbol is omitted from an optional-symbol command (closeall, closecancelall, closeallprofit, closeallloss) and no magic is given, the command affects every position and pending order on the MT5 terminal, including trades opened manually and by other EAs. That magic-less symbol-less form is an emergency brake for the entire account; use it only when you intend to flatten everything. Adding magic=N to the symbol-less form narrows it to that strategy's positions across all symbols. closealleaoff and closecancelalleaoff are always global — they ignore any symbol or magic you include and flatten the whole account regardless (the EA prints a corrective note in the Experts tab when a scope was supplied).

Magic number behavior. In Single-magic mode (the default), a close command with magic absent or set to any number only touches positions opened with the EA's configured magic number and does not touch manual trades or other EAs' positions — except the magic-less symbol-less variant, which is the full-account brake, and magic=ALL, which sweeps every magic. In Multi-Strategy mode, magic=N restricts the command to positions with that exact magic (with or without a symbol), magic=0 targets only manual (magic-0) trades, and magic=ALL sweeps every magic on the scope; a symbol-scoped command that omits magic entirely is rejected.

Delayed closes are a paid-plan feature. The delay= parameter is handled the same way for close commands as for any other command: on a Trial plan it is rejected with HTTP 402 ("Delayed signals require a paid plan. Upgrade to use delay=."); on a paid plan the close is queued and delivered after the delay. There is no close-specific rejection of delay=. A delay= above the 24-hour platform maximum (86,400 s) returns HTTP 400 on any plan. In practice most users close immediately (no delay=), but the parameter is not blocked on close.

Deduplication. If the same signal is delivered more than once (a network retry), the EA detects the duplicate via its execution history and skips subsequent deliveries. A "Duplicate signal" message appears in the MetaTrader Experts tab.

Repeated partial closes are intentionally NOT collapsed. The server briefly collapses byte-identical webhooks (to absorb TradingView retries) — but partial-close commands are exempt from that collapse. This lets a strategy deliberately fire two identical closelong close_pct=50 to scale out 50% then another 50% (because close_pct is measured against the original entry volume, the two sum to the full position). The trade-off: if a partial-close alert is a genuine TradingView retry rather than an intentional repeat, it may execute twice — so avoid configuring TradingView to resend partial-close alerts. Full closes and opening commands are still collapsed (a retried open would otherwise double-fire).

The exemption applies to closelong/closeshort only. Only those two commands honor close_pct/close_lots, so only they are exempted from collapse when they carry one. A sweep command (closeall, closeallprofit, closeallloss, closecancelall, etc.) does not support partial close — so even if one arrives with a stray close_pct/close_lots, the parameter is ignored and the duplicate is still de-duplicated on retry. The "may execute twice" trade-off above is specific to genuine partial closes on closelong/closeshort.


Error Messages and Meanings#

Group A: Validation rejections#

These errors occur before the signal reaches the EA. The platform returns an HTTP 400 response immediately. Two places show the rejection:

  • Signal Logs → Rejected Signals tab in your dashboard. The row shows the timestamp, license, command, symbol, and the verbatim rejection reason. This tab is the primary self-service surface; always check here first. A row is created only when the platform can extract a valid license from the payload. Signals with an unparseable license do not appear here.
  • TradingView alert execution status: TradingView displays the HTTP 400 response body directly on the alert, so you may also see the reason there.
MessageCauseWhat to do
Invalid close_pct={value}. Must be between 0 (exclusive) and 100 (inclusive).close_pct was zero, negative, or above 100Change close_pct to a value greater than 0 and up to 100.
Conflicting partial close parameters: close_pct, close_lots. Use either close_pct (percentage) or close_lots (fixed volume), not both.Both close_pct and close_lots were present in the same signalRemove one of the two parameters. Use close_pct for a percentage of the original volume, or close_lots for a fixed volume. Not both.
Invalid close_lots={value}. Must be greater than 0.close_lots was zero or negativeSet close_lots to a positive number that does not exceed the position size.
close_lots is implausibly large (got {value}, max 100000).close_lots exceeded the 100,000 ceiling (the same cap the per-target ladder close_lots uses)Use a realistic close volume that does not exceed the position size.
close_lots={value} could not close any position on SYMBOL — it is below the broker minimum lot, or partially closing it would strand a sub-minimum remainder. Nothing was closed…A positive close_lots smaller than the broker's minimum closeable lot (or one that would leave a sub-minimum dust remainder) closed nothing. This is an EA-side failure ack; the position is unchanged. Previously this case could be mis-reported as a success while the position stayed fully open.Increase close_lots to at least the broker minimum lot for that symbol, or use close_pct instead.
Invalid minprofit={value}. Must be >= 0 (pips magnitude).minprofit was negativeSet minprofit to 0 or a positive pip count.
Invalid maxloss={value}. Must be >= 0 (pips magnitude).maxloss was negativeSet maxloss to 0 or a positive pip count.
"Invalid symbol ..." or similar symbol format errorSymbol contained special characters, spaces, or exceeded 20 charactersUse only letters and digits (e.g., EURUSD, XAUUSD, US30). Remove slashes, hyphens, and spaces.

Group B: EA runtime results#

These messages appear after the signal has reached the EA successfully. Check the MetaTrader Experts tab and the EA support log file.

MessageCauseWhat to do
"Partial close: X of Y positions closed on SYMBOL"Some positions matching the filter were closed; others failed at the broker levelCheck the MetaTrader Experts tab for the specific broker error code on the failed positions. Common causes: broker temporarily halted trading on the symbol, or insufficient margin for the opposite-direction leg of the close.
Partial / failed close ack with a residual remaining (retry suggested)The broker only partially filled the market close on a single position — rare, caused by thin liquidity or a broker max-volume-per-deal limit. The EA now reports the close as partial/failed rather than a clean success, so the still-open residual is visible. Applies to closelong, closeshort, closeall, closeallprofit, and closeallloss.Re-send the same close command to clear the residual exposure. If it keeps partially filling, the symbol's liquidity or the broker's per-deal volume cap is the constraint; close in smaller steps with close_lots or close_pct.
"Partial closecancelall: closed X/Y positions, cancelled Z/W orders on SYMBOL"The compound command partially succeeded; some closes or cancels failed at the brokerSame as above. Review the Experts tab for per-ticket broker errors.
"Partial closecancelall: closed X/Y positions on SYMBOL (cancel ok)"All cancels succeeded but some position closes failedFocus troubleshooting on the failed position closes.
"Partial closecancelall: cancelled Z/W orders on SYMBOL (close ok)"All position closes succeeded but some pending-order cancels failedFocus troubleshooting on the failed order cancels.
"Duplicate signal"The platform delivered the same signal twice; the EA skipped the second executionNo action needed. This is normal behavior on retried deliveries.

Where to look#

SymptomWhere to look first
Signal never appeared to run / TradingView shows an errorSignal Logs → Rejected Signals tab
Signal shows accepted in Signal Logs but trade did not closeMetaTrader Experts tab and EA support log
Signal accepted, position partially closedMetaTrader Experts tab for broker-level error detail
"Extreme volatility" amber pill on the Signal Logs entryNo action needed. The close succeeded; the pill is informational
No Rejected Signals row exists and no Experts tab messageConfirm the EA is online and the WebSocket is connected (check the license status in the dashboard)

Plan and Tier Differences#

FeatureTrialStandardProPremium
All close commands availableYesYesYesYes
Execute on inactive/expired licenseYesYesYesYes
Rate limit (signals per minute)601504501,500
Rate limit (signals per day)5,00010,00030,000100,000
delay= parameter with close commandsNot available (HTTP 402)AvailableAvailableAvailable

Close commands are the one category of signal that is fully available on every tier, including Trial, because you must always be able to exit a position. There are no tier-specific restrictions on which close commands can be used, which symbols can be targeted, or how many positions can be closed per command.

Rate limits do not drop close commands. A close still increments the per-minute and per-day counters, but it is never rejected when a cap is reached (a kill-switch can only reduce exposure, never increase it). Only entry commands (buy, sell, pending orders) receive an HTTP 429 and are dropped when a cap is exceeded, so a close always gets through even while your entry signals are being rate-limited.

When a subscription lapses mid-trade, entry commands are immediately blocked; close commands remain available, so open positions can still be exited.


Known Edge Cases and Gotchas#

  • The symbol-less kill switch (closeall, closecancelall, etc. without a symbol and without a magic) affects every position on the terminal, including manual trades and positions from other EAs. To close only your own EA's positions, include a symbol or add a magic filter — magic=N is honored even on the symbol-less form and narrows it to that strategy across all symbols.

  • close_pct is calculated against the original entry volume, not the current remaining volume. If you have already partially closed a position and expect close_pct=50 to halve the remaining volume again, you'll get a different result. Use close_lots for precise control after multiple partial closes.

  • close_pct=100 and omitting close_pct entirely both result in a full close. There is no behavioral difference.

  • Extreme slippage is disclosed via the "Extreme volatility" amber pill in Signal Logs but does not cause the close to fail or be rolled back. The position is closed regardless.

  • The delay= parameter follows the standard plan gate on close commands, just like any other command: a Trial plan returns HTTP 402, while paid plans queue the close for delivery after the delay. It is not silently dropped or close-specifically rejected.

  • In Multi-Strategy mode, a symbol-scoped close command that omits magic is rejected — use magic=ALL to sweep every magic on the symbol (magic=0 targets only manual/magic-0 trades). This is different from Single-magic mode, where the EA's default magic is applied automatically.

  • closeallprofit and closeallloss evaluate profitability at the moment the EA processes the signal. Whether a position is a winner or loser is judged on net P&L — floating (price) profit plus swap and commission — using the live bid/ask prices at that instant; the optional minprofit/maxloss thresholds are then applied in price pips. If the position's profit crossed the threshold when the signal was sent but then retreated before the EA processed it, the position will not be closed. Likewise, a position that is up on price but net-negative after swap/commission is treated as a loss, not a winner.

  • closecancelall always closes positions in full. close_pct and close_lots do not apply to this command.

  • closealleaoff and closecancelalleaoff disable the EA after execution, and the disable is sticky: the EA will not accept further entry signals until you send eaon,ALL. A symbol-specific eaon, a dashboard settings update, and a manual restart in MetaTrader will not lift it — the emergency stop is persisted to disk and survives a restart.


Frequently Asked Questions#

Q: Can I use close commands if my subscription has expired? A: Yes. Close commands are the one exception to the standard subscription requirement. The platform accepts them even on inactive or expired licenses so you're never locked out of exiting a position. Entry commands (buy, sell, pending orders) remain blocked until the subscription is renewed.

Q: Will closeall without a symbol close positions I opened manually in MetaTrader? A: Yes — when it carries no magic. The magic-less symbol-less variant of closeall is a true account-wide kill switch: it closes every open position on the terminal regardless of how it was opened, including manual trades and positions from other Expert Advisors. To close only positions opened by this EA, include the symbol or add a magic filter (magic=N is honored even without a symbol and closes only that strategy across all symbols).

Q: What is the difference between closeall and closecancelall? A: closeall closes all open positions for the specified symbol (or all symbols if symbol-less). closecancelall does the same and also cancels all pending limit and stop orders matching the same filter. Use closecancelall when you want to both exit positions and remove standing orders in one command.

Q: Can I partially close a position? A: Yes, using closelong or closeshort with either the close_pct parameter (percentage of the original entry volume) or the close_lots parameter (a fixed lot amount). These partial-close parameters are not available on closeall, closecancelall, closeallprofit, closeallloss, closealleaoff, or closecancelalleaoff; those commands always close in full.

Q: Why did close_pct=50 close a different volume than I expected? A: close_pct is applied to the position's original entry volume, not its current remaining volume. If you have already partially closed the position, 50% of the original entry may be greater than or equal to the remaining volume, causing a full close. The volume is also floored to the broker's minimum lot step, which can reduce it slightly. For precise volume control after prior partial closes, use close_lots instead.

Q: Will close commands execute even if a symbol is disabled with eaoff? A: Yes. Close commands bypass all symbol filters: whitelist, blacklist, and per-symbol eaoff settings. Disabling a symbol prevents new trades from being opened on it; it does not prevent existing positions from being closed.

Q: Is there a limit on how many close commands I can send? A: Close commands increment the same per-minute and per-day counters as every other command, but they are never rejected when a cap is reached. The limits are: Trial 60/min and 5,000/day; Standard 150/min and 10,000/day; Pro 450/min and 30,000/day; Premium 1,500/min and 100,000/day. When a cap is exceeded only entry commands receive an HTTP 429 and are dropped; a close always executes.

Q: Can I use delay= with a close command? A: It depends on the plan. delay= is a paid-plan feature and works the same on close commands as on any other: on a Trial plan a close with delay= is rejected with HTTP 402 (upgrade prompt); on a paid plan the close is queued and delivered after the delay. Most users close immediately and omit delay= entirely. A delay= over the 24-hour maximum is rejected with HTTP 400 on any plan.

Q: What does the "Extreme volatility" amber pill in Signal Logs mean? A: It means the close executed successfully but the fill price differed from the reference price at the moment the close was submitted by more than the extreme-slippage threshold. This commonly happens during high-impact news events or illiquid market conditions. The position is closed; the pill is purely informational to help you understand why the exit price differed from the displayed price.

Q: How do I close only positions that have lost more than a certain number of pips? A: Use closeallloss without a maxloss parameter to close all losing positions, or with maxloss set to close only those within a pip range. To target only smaller losers, set maxloss to the desired pip ceiling; positions exceeding that loss are left open. There is currently no built-in command to close only positions beyond a minimum loss threshold; the closest approach is closeallloss without a filter (closes all losers) combined with manual review.

Q: What happens if the EA is offline when I send a close command? A: The platform queues the signal and delivers it when the EA reconnects. The close will execute at the market price at the time of delivery, not the time the signal was sent. If the EA remains offline for an extended period, the position remains open during that time.

Q: Can I close positions from a specific strategy only, in Multi-Strategy mode? A: Yes. Include the magic= parameter with the strategy's magic number. Only positions with that exact magic will be affected. Use magic=ALL to sweep every magic on the symbol; omitting magic entirely on a symbol-scoped command is rejected in Multi-Strategy mode.