Reference guide · Support Bots

Emergency Close: Understanding Emergency Position Liquidation

When and how to use this exceptional tool, what safeguards it checks, and why every closure must be confirmed at IBKR.

Support Bots · Exceptional operationIBKR · PAPER / LIVEMARKET orders · Confirmation required
Show the 29 guide sections
01

Why Emergency Close exists

An exceptional operation to reduce unwanted market exposure quickly.

Emergency Close allows the client to request closure of open positions on the configured Interactive Brokers account when the normal portfolio lifecycle no longer meets an immediate need. It does not select new stocks and does not replace Entry Bot for entries or Risk Bot for protection management.

This is an exceptional, manually initiated action from Control Center. It can have irreversible financial consequences: closed positions do not automatically reappear in the portfolio.

!

Remember: an emergency close is not a pause button. It submits actual market orders to IBKR.

02

When might it be appropriate?

Reserve it for circumstances requiring immediate risk reduction.

01

Unacceptable exposure

The client wants to close several positions without waiting for their normal exit rules.

02

Confirmed operational incident

A verified issue justifies a liquidation decision after reviewing actual open positions.

03

Exceptional human decision

The client chooses to liquidate during the session, understanding potential costs and execution risks.

A temporarily unavailable monitoring screen, an unrealized loss, or simple uncertainty does not by itself justify liquidating a portfolio. Review the situation and contact Support if necessary.

03

What Emergency Close does not do

Do not confuse closing holdings, blocking new entries, and adjusting protective orders.

NeedAppropriate componentPractical meaning
Prevent future purchasesTrading Mode NONEBlocks new entries while existing positions remain managed.
Manage TP, SL, and trailingRisk BotMaintains protective orders according to active rules.
Exceptionally replace TP/SL ordersEmergency TP/SL OverrideChanges protection orders; does not request full liquidation.
Close positions immediatelyEmergency CloseSubmits liquidation requests subject to the safeguards below.
i

Important: these tools have different objectives. Emergency Close is not the right choice merely to disable new buys.

04

Where to find it in Control Center

A Support Bots function started deliberately by the client.

Under Support Bots → Emergency Close, Control Center shows the procedure status and the configured IBKR account’s open positions. The user can refresh the position list, choose which positions to close, and review execution status.

  1. Open Emergency Close from Support Bots.
  2. Refresh positions to obtain the current IBKR snapshot.
  3. Choose selected holdings or the entire portfolio.
  4. Review the confirmation and approve only when the displayed symbols and quantities match your intent.
  5. Follow the outcome and verify the final position state with IBKR.

There is no need to use a command line, edit configuration files, or run a program directly on the VPS.

05

PAPER versus LIVE: understand the consequences

The same VPS can be connected to the selected IBKR environment.

PAPER simulates orders, whereas LIVE involves actual transactions. Emergency Close is not inherently restricted to PAPER: LIVE execution is possible when operationally authorized.

Always verify the active IBKR environment and the account shown before approval. Do not assume an operation is simulated merely because it starts from a test VPS or a familiar screen.

!

Real financial risk: in LIVE, market orders can realize losses, incur fees, and execute at prices different from those displayed.

06

When is emergency closing available?

Only during regular market hours confirmed by IBKR.

The bot checks the general 9:30 AM–4:00 PM New York time window along with actual liquid trading hours returned by IBKR. It performs a pre-intervention check and checks the relevant instruments again as they are processed.

A holiday, early close, or unconfirmed contract schedule may prevent an operation even during the typical clock window. This procedure does not permit outside-RTH execution.

07

Required safeguards before starting

Actions depend on verifiable conditions, not assumptions.

  1. IBKR must be reachable and the intended account confirmed.
  2. Emergency state must be clear: no active or unresolved prior operation.
  3. Positions must be refreshed and selection must be coherent.
  4. Regular trading hours must be confirmed by the market checks.
  5. The client must explicitly approve the operation in Control Center.

If status information is missing, ambiguous, or invalid, the bot refuses the operation instead of assuming the system is healthy.

08

Selected positions or the entire portfolio

Two different scopes, both requiring explicit approval.

1–5

Selected positions

Choose one to five distinct positions for targeted closure.

ALL

All positions

The “All positions” option targets all open holdings visible in the configured IBKR account.

✓

Pre-launch review

A dialog summarizes the number of holdings, their symbols, and quantities before confirmation.

The five-position limit applies only to selected mode. It does not cap the number of positions when “All positions” is used.

09

Refresh before making a decision

A read-only preview, not a locked reservation of holdings.

Refresh positions requests an up-to-date IBKR snapshot via a separate read-only connection. Positions are identified by the broker’s contract identity to distinguish instruments accurately.

The snapshot may become stale if another trade fills between preview and execution. Emergency Close therefore checks positions again after approval and refuses a selection that is no longer coherent.

10

Explicit user confirmation

Human approval before any liquidation orders.

Control Center presents a confirmation dialog containing the intended symbols and quantities. The user may cancel or choose “I confirm”. Approval is passed to the execution component with an internal confirmation tied to the account and chosen scope.

!

Do not confuse: confirming the request permits execution checks and orders to begin. It does not certify execution prices, final filled quantities, or closure of every position.

11

Only one emergency operation at a time

Prevent concurrent coordinators from controlling the same account.

The operation acquires an exclusive lock and publishes Emergency_in_progress. A second operation cannot start while another one is underway or an earlier unresolved state remains.

Other ecosystem components consult this state to avoid incompatible actions. If something fails, the status can remain Emergency_failed until reconciliation and controlled recovery.

12

Coordinating with Risk Bot

Prevent Risk Bot from rebuilding protections during liquidation.

Before taking control, the coordinator requests Risk Bot to stop and verifies that it is no longer running. It then temporarily handles the relevant order operations through a controlled IBKR connection.

If Risk Bot remains running or restarts during the emergency, the unsafe stage is refused. Stopping Risk Bot does not mean its existing IBKR protective orders have disappeared; these require separate checks.

13

Canceling existing protective orders

Avoid stacking liquidation orders on still-active protective orders.

For each holding, Emergency Close locates associated open IBKR orders, requests their cancellation, and checks that no relevant order remains active. If order ownership is ambiguous or cancellation cannot be confirmed, the bot refuses to send a liquidation order for that holding.

This procedure is repeated per instrument, reducing the chance that an existing take-profit, stop-loss, or trailing order conflicts with the new closing order.

!

Sensitive interval: between confirmed cancellation of protections and actual closure, the position may remain exposed to market moves. Emergency operation does not eliminate that risk.

14

What orders are submitted?

MARKET orders sized to the actual position.

Once checks succeed for a position, the bot submits a MARKET order valid for the trading day and restricted to regular hours. It sells a long position or buys back a short position.

It verifies the IBKR contract and current position quantity before submission. MARKET orders prioritize execution but do not guarantee price; slippage can be substantial in fast markets.

15

How multiple positions are handled

Check each symbol separately without waiting for every prior fill.

01

Verify the instrument

Account, contract, trading session, and quantity are checked.

02

Confirm cancellation

Associated protective orders are canceled, and their absence is verified.

03

Submit MARKET

The symbol’s liquidation order is submitted and its identity is recorded.

04

Move to the next

Another holding can be prepared while an earlier submitted order is still filling.

05

Global reconciliation

All holdings and orders are inspected after the observation window.

This is neither blind simultaneous submission nor strict completion of one instrument before proceeding. Each holding has its own cancellation proof before its close order.

16

Why there is no blind automatic retry

A lost API response does not prove IBKR never received the order.

The program records order intent before sending it. If IBKR’s response is uncertain or the connection drops, it does not assume failure and does not submit another MARKET order blindly for the same instrument.

Replaying an uncertain close could over-trade or even open the opposite position. Orders, executions, and remaining positions must first be reconciled against broker records.

17

Partial fill, rejection, or missing response

Different outcomes require different follow-up checks.

SituationHow to interpret it
Submitted but still activeThe holding may continue changing; “Submitted” does not mean “closed.”
Partially filledA residual quantity may remain and require protection or a controlled intervention.
RejectedThe broker may leave the position unchanged; review the rejection and remaining protection.
Connection lostNo API response does not establish that no trade occurred; prioritize broker verification.
Position flat, no active orderNecessary condition for confirmed closure of that instrument.
!

Avoid: do not immediately run Emergency Close again just to “finish” without checking what remains live at IBKR.

18

When is a position truly closed?

No residual holding and no associated active order at the broker.

After monitoring, the bot refreshes IBKR positions, open orders, and executions. A holding is recorded as FLAT_CONFIRMED only when the broker shows no residual position or active order for that instrument and its order submission was not left uncertain.

The full operation is marked completed only after every requested holding is reconciled. A submission acknowledgment alone is insufficient.

19

Reading Control Center status

Three primary conditions, with particular attention to blocked states.

Displayed statusPractical meaning
No Emergency Procedure in ProgressThe current status does not indicate an active emergency.
Emergency Procedure in ProgressLiquidation is being prepared, submitted, monitored, or reconciled.
Emergency Procedure Failed — Recovery RequiredA step failed or outcome is uncertain; reconciliation is required.
Emergency Status Invalid / UnavailableThe system cannot establish safe status and dependent actions remain blocked.

Control Center can show a count of confirmed closed holdings against requested holdings. An incomplete count does not prove remaining orders were canceled.

20

What happens if it fails?

Reconcile actual broker state before considering another action.

Changed quantities, unconfirmed cancellations, IBKR errors, disconnections, or unresolved closures may result in Emergency_failed. This state preserves evidence that the intervention was not fully verified.

  1. Inspect the current positions and open orders directly at IBKR.
  2. Identify residual quantities and check whether protective orders remain active.
  3. Record the time, affected symbols, and any error messages.
  4. Contact SB-ITM Support for controlled reconciliation before another attempt.

Resetting an emergency status must never be used to conceal unknown executions or open orders.

21

Interaction with Entry Bot

Block new entries during an active or unresolved emergency.

Entry Bot checks the shared emergency status before new entry submissions. While an emergency is active, failed, or unreadable, new entry submissions are blocked rather than treated as safe.

This safeguard does not manage IBKR orders already submitted before the emergency: they may still change status. Emergency Close is not a universal cancellation of every outstanding entry order.

22

Interaction with Watchdog

Allow Risk Bot recovery only after a safe release of emergency control.

Watchdog respects emergency status and avoids restarting Risk Bot while Emergency Close controls the process. After a successful operation releases its emergency state, Watchdog may resume normal supervision.

Following failure or ambiguous status, never assume Risk Bot has restarted or residual holdings are protected. Review the real broker and service state.

23

Audit trail and traceability

Record actual broker events without inventing executions.

Emergency Close records an operation reference, intended orders, and executions received from IBKR. Broker order and execution identifiers support later reconciliation, including potentially delayed fills.

These records support audits and diagnosis. They do not replace broker statements, and the bot does not directly fabricate missing Trade Register entries.

24

Example: close three selected holdings

An illustrative “Selected positions” workflow.

Illustrative scenario

A client sees three holdings whose exposure is no longer acceptable. They refresh positions, select the three stocks, review quantities, and confirm.

For each holding, the system checks IBKR state, cancels and verifies protection orders, and submits a market close order. The final reconciliation may report three holdings closed out of three.

If even one remains open, the overall procedure is not confirmed successful; the broker state must be checked before acting again.

25

Example: liquidate the entire portfolio

A broader operation does not bypass safety checks.

Illustrative scenario

The client selects “All positions” on an account with many holdings. The interface summarizes the visible holdings and asks for explicit approval.

The program attempts to handle instruments independently. A failure on one symbol does not erase orders already submitted for another.

Even if most holdings are closed, any residual contract, uncertain order, or disconnection requires reconciliation: “close all” does not promise immediate 100% fills.

26

Important limitations

A conservative system may refuse action when evidence is insufficient.

IBKR

Broker dependency

The tool depends on IBKR connectivity, permissions, contracts, trading hours, and confirmations.

MARKET

Price exposure

Liquidity and volatility affect the actual execution price.

State

Safety block

Ambiguous status or unconfirmed cancellations can block unsafe actions.

Behavior described here was inspected in the supplied code; no LIVE liquidation certification is claimed on this page.

27

Client best practices

Limit unsafe interventions and preserve useful diagnostics.

  1. Use Emergency Close only after identifying exactly which positions should be closed.
  2. Verify PAPER versus LIVE and the intended account.
  3. Never assume closing a Control Center window cancels orders already sent to IBKR.
  4. Check the final result, residual holdings, and remaining protective orders.
  5. If the result is uncertain, open a Web Portal → Support ticket before repeating any operation.

If the objective is simply to prevent new purchases, use the appropriate Trading Mode instead of liquidation.

28

Frequently asked questions

Direct answers before a potentially irreversible action.

Can I close more than five holdings?

Yes, using “All positions.” The limit of five applies to selected mode only.

Can I use it before the open or after the close?

No. The bot requires regular US trading hours and verified IBKR liquid hours for the instruments.

Does MARKET guarantee the last price shown?

No. The final execution price and timing depend on market conditions and IBKR.

Does “completed” prove Risk Bot protects any remaining holdings?

No. Service state and actual protections must be independently reviewed when holdings remain or the procedure failed.

Is Emergency Close strictly PAPER-only?

No. LIVE execution is possible when authorized, with real financial consequences.