Reference guide · Core Bots

Risk Bot: understanding and safeguarding positions

From a detected purchase to verified IBKR orders: take profit, stop loss, trailing stops, quantity reconciliation and incident recovery.

Core Bots · Portfolio protectionTP/SL · OCA · Trailing stopsIBKR order reconciliation
01

Risk Bot: purpose and responsibilities

The component that tracks holdings and their actual IBKR protection orders.

Risk Bot is SB-ITM’s open-position protection engine. When a stock enters the portfolio, it identifies the quantity actually held, establishes the applicable protective orders and then monitors their status at Interactive Brokers (IBKR).

It operates after a potential Entry Bot purchase, but it also monitors positions that already exist at startup. It manages take-profit (TP) targets, stop-loss (SL) limits and any subsequent transition to a trailing stop, which adjusts as the price moves favorably.

!

Safety principle: a locally created order, displayed order ID or confirmed purchase is not sufficient proof that a position is protected. The broker-side protection must be verified.

02

Risk Bot in the SB-ITM workflow

Entry, protection and supervision have separate responsibilities.

Scanners and the Morning Decision Chain prepare analyses, while Entry Bot may submit a BUY. Risk Bot does not select stocks to purchase: it takes over management of actual holdings, whether they originated from Swing or Intraday workflows.

01

Preparation

Scan A, Scan B and the decision workflow identify potential candidates.

02

Execution

Entry Bot checks conditions and may submit an IBKR purchase.

03

Protection

Risk Bot verifies positions and their actual protective SELL orders.

04

Supervision

Watchdog monitors service availability without taking over Risk Bot’s protection logic.

Dashboards and Open Position Monitor provide visibility; they are not substitutes for actual protective orders accepted by IBKR.

03

Understanding TP, SL and trailing stops

Three tools serving different purposes.

A take-profit is a limit SELL intended to close a holding at a favorable level, subject to execution. A stop-loss is a stop order intended to reduce exposure when price moves adversely; the execution price is not guaranteed, especially through sudden moves or gaps. A trailing stop is a stop level that adjusts as the stock moves favorably.

These orders do not promise a profit or a precisely capped loss. Quotation rules, spreads, liquidity and market conditions can affect execution.

04

After a buy: the protection sequence

Risk Bot waits for the necessary confirmations before protecting a settled quantity.

An order may fill in stages. The quantity displayed during that process is not necessarily the final holding. Risk Bot therefore checks that the originating BUY is no longer executable and the broker-side position quantity is stable, then refreshes IBKR information immediately before acting.

  1. IBKR reports a new holding or a quantity change.
  2. Risk Bot verifies the BUY is no longer active and the position has settled.
  3. It identifies the correct Swing or Intraday protection rules.
  4. It checks for existing protection to avoid conflicting SELL orders.
  5. It submits protections and checks their actual IBKR status.
!

Protection may be pending during this transition. Acting prematurely can create the wrong SELL quantity; an unusually long delay requires investigation.

05

The TP/SL pair and OCA group

Two potential exits linked to avoid conflicting sales.

For an eligible new holding, Risk Bot normally places a take-profit limit order and a stop-loss stop order. They share an OCA — One Cancels All group: after one order executes, the broker should cancel the related order under IBKR’s OCA handling.

Risk Bot expects a coherent pair: same contract, same account, the live holding quantity and one shared OCA group. One missing order, mismatched group or incorrect quantity is not treated as full protection.

i

OCA does not eliminate every risk: broker interruption, latency or pending cancellations still require an actual status check.

06

Swing vs Intraday: different risk rules

Correctly classifying each holding is critical.

A Swing position follows the Swing TP/SL settings and a market-regime-specific trailing matrix. An Intraday holding uses separate settings, notably its entry-specific initial stop-loss and trailing trigger.

Entry Bot prepares the Intraday risk classification before submitting the BUY. Risk Bot verifies that classification against the IBKR account and exact contract. If classification information is missing, unreadable or contradictory, it must not arbitrarily substitute Swing stop settings for an Intraday position.

!

Example: an incorrectly classified Intraday purchase could receive a stop intended for Swing holdings. The system can therefore block an automatic rebuild when classification cannot be verified.

07

Intraday stop-loss fixed at entry

A risk profile prepared before the purchase is submitted.

For current Intraday entries, the applicable initial stop comes from the validated Intraday regime when Entry Bot prepares the order (FAVORABLE, NEUTRAL or UNFAVORABLE). Its association with the account and exact broker contract is preserved; it must not be silently rewritten when market context changes later.

The code also has a distinct compatibility path for historical Intraday positions created before this handoff mechanism existed. That compatibility does not authorize guessing an unknown position’s classification.

08

The three Swing trailing regimes

BULL, RANGE and DEFENSIVE are distinct from the Intraday regime.

For Swing holdings, Risk Bot loads the trailing matrix associated with the BULL, RANGE or DEFENSIVE market regime. Each matrix defines price-move triggers and the associated trailing-stop distances.

The regime comes from Regime Bot’s result. If that source cannot be used, Risk Bot selects an explicitly configured fallback profile. The chosen matrix is loaded as the Risk Bot process starts; do not assume every subsequent market movement automatically rewrites open orders.

09

The four Swing trailing levels

An L1-to-L4 progression—not four simultaneous SELL orders.

Swing positions have four successive levels: L1, L2, L3 and L4. Each combines a trigger threshold, relative to the entry price, with a trailing-stop percentage. When price reaches a trigger, Risk Bot can replace TP/SL protection with a trailing stop and later upgrade that stop as additional levels are reached.

It does not place four independent stops against the same holding. If a price gap crosses multiple thresholds, the bot can target the highest already reached level. Upgrades must avoid two overlapping active trailing orders.

10

Intraday trailing: a single level

A separate design from the Swing four-level matrix.

Intraday trailing uses its own trigger and trailing distance. Once activated, it remains the position’s trailing protection; it does not advance through Swing’s four levels.

This avoids mixing protection rules for positions intended to remain open over several sessions with those for a move detected during one trading session. Users can inspect their selected settings in Control Center; this guide does not present one fixed percentage as the universal client configuration.

11

Switching TP/SL to a trailing stop

Cancellation must be confirmed before placing the replacement order.

When the trigger is reached, Risk Bot does not immediately stack another SELL order on top of the existing protections. It first requests cancellation of the TP and SL, awaits broker confirmation, checks for leftover protective orders and verifies no other live trailing stop remains.

Only after reconciliation may it submit the new trailing protection. If cancellation remains pending, the transition is deferred and can resume during a subsequent check. This reduces the risk of multiple executable SELL orders against the same share quantity.

!

Important: acknowledgment that cancellation was requested does not prove the order was cancelled. During a transition, rely on actual IBKR statuses.

12

Upgrading a Swing trailing stop

Replacement avoids deliberately overlapping orders.

Once Swing trailing is active, Risk Bot monitors subsequent level triggers. When a higher level is reached, it identifies the current trailing order, requests cancellation and waits for confirmation before placing the replacement stop.

If the previous order has an uncertain status, the upgrade is deferred rather than risking another competing SELL. The four levels are price conditions—not a schedule or a guarantee that price will reach L4.

13

Market hours and price monitoring

Existing protection and trailing activation are separate actions.

Trailing activation and upgrades may be restricted to regular U.S. market hours, according to the enabled setting. When that restriction applies, Risk Bot continues protective-order supervision but avoids triggering or upgrading trailing stops outside the intended window.

It uses available market prices and avoids treating a previous closing price as a live trigger. Missing market data can delay a trailing decision; the status of existing broker-side protection is a separate matter.

14

Market data: protect open positions first

A protective order and a live quote serve different purposes.

To evaluate trailing triggers, Risk Bot needs live prices for held stocks. IBKR can limit simultaneous market-data streams or temporarily reject a subscription. Risk Bot records these incidents and reports market-data pressure to Entry Bot so open holdings take priority over monitoring possible new purchases.

Missing quotes must not cause invented trailing decisions. Likewise, missing market data does not automatically mean all broker-side protection orders disappeared; their status must be assessed separately at IBKR.

15

Restarting: recovering real holdings and orders

Recovery relies on IBKR broker state, not merely local process memory.

On startup, Risk Bot requests target-account positions and open orders from IBKR, including those created in previous sessions. It identifies the TP/SL pairs or trailing orders associated with each exact contract so it can resume management without blindly recreating SELL orders.

An OCA pair is reported as recovered and protected only when both orders are accepted, cover the actual live quantity, share the same group and have no conflicting extra SELL orders. A trailing order also needs a coherent status and quantity. Otherwise, the bot reports that IBKR verification is required.

16

Continuous reconciliation of quantities and orders

Protection that was correct yesterday can become wrong after a holding changes.

Risk Bot runs periodic protection checks in addition to reacting to IBKR events. It compares the quantities of protective orders with the live holding quantity. After a partial exit, additional purchase or another change, an older SELL quantity may no longer be appropriate.

The program reconciles the state before rebuilding what is required. It avoids cancel/recreate loops caused by delayed IBKR status propagation and defers replacement while previous orders remain unresolved.

17

Partial exits and quantity changes

Preventing an oversized SELL is as important as covering the position.

A 100-share position may become 60 shares after a partial exit. If a protective SELL still targets 100 shares, the issue is not merely incomplete coverage: there is also a risk of selling more than is held. Risk Bot therefore checks current holdings before creating or modifying protections.

Similarly, a holding that is still increasing during a partially filled BUY needs time to settle before protection quantities are recalculated. This caution does not eliminate the need to investigate any “protection not confirmed” status.

18

Safety states and broker confirmations

A processing state is not the same as broker-verified protection.

A holding may pass through several phases: new and waiting, active TP/SL pair, partial reconstruction, pending cancellation, active trailing or fully closed. Logs and Control Center indicators help explain this progression.

Distinguish “request sent”, “awaiting confirmation” and “active and verified”. A completed process step or order ID never replaces actual IBKR-order confirmation. Critical exceptions are logged rather than hidden.

19

Reading Control Center’s Risk screen

Settings and actual operational status serve different purposes.

Under Parameters → Risk, Control Center shows the authorized configurable settings, separately for Swing and Intraday. It includes TP/SL values and, for Swing, regime-specific trailing matrices. These reflect the chosen configuration—not expected performance.

Control Center Risk parameters — Swing TP/SL and BULL, RANGE, DEFENSIVE trailing levels
Example Control Center settings. Percentages in this screenshot are not performance recommendations.

To determine the actual protection status of a particular position, also inspect execution information, logs and IBKR open orders. The settings page alone does not prove that broker-side protective orders were accepted.

20

Settings changes: when do they take effect?

Do not imply that editing a value retroactively rewrites every open order.

TP/SL settings, trailing profiles and regimes are applied at different stages in a position’s life. A Control Center setting change must not be interpreted as an immediate automatic reset of every existing broker-side order.

Preconfigured strategy profiles are optional startup aids. They affect permitted parameters for future new entries, do not override users’ manual changes and do not independently rewrite trailing levels. Changing protection on existing positions requires a separate, verified procedure.

i

Do not confuse: setting a new TP/SL for future entries, changing trailing levels and replacing currently active orders on an existing position are three distinct actions.

21

Emergency operations: strict coordination

Risk Bot remains the final owner of protective-order management.

SB-ITM has emergency procedures separate from routine protection management. During an Emergency TP/SL Override, coordination stops Risk Bot once for the entire operation, then processes existing protection cancellations before Risk Bot reconstructs protections after all cancellations have finished.

Holdings are processed in batches of up to five, but protections must not be rebuilt between cancellation batches. Existing trailing stops are outside this TP/SL override procedure. Execution requires explicit confirmation and environment checks; the reviewed version can permit LIVE when specifically enabled, so it is not technically PAPER-only. Watchdog coordination is involved in service recovery; customers should not improvise the sequence.

!

Safety: do not bypass emergency status, protective-order replacement or pending cancellations by manually editing or restarting scripts.

22

Risk Bot, Watchdog and service continuity

A running process does not prove every position is protected.

Watchdog monitors Risk Bot availability and can perform permitted recovery after an interruption. It respects emergency-operation locks and planned restart windows. Entry Bot can also check Risk Bot availability before certain new purchases.

Three facts must be kept separate: Risk Bot is running, it is connected to the correct IBKR account, and every holding has valid protection orders. Knowing one does not prove the other two. Ambiguous states call for investigation, not repeated forced restarts.

23

Risk Bot and Open Position Monitor

Visualization remains read-only.

Open Position Monitor displays portfolio position information and evolution in Control Center. It is a read-only monitoring component: it does not place, cancel or replace IBKR protection orders.

A frozen chart does not automatically mean Risk Bot stopped managing orders; a working chart is not proof of broker protection either. Investigate using Risk Bot status, monitoring events and the actual IBKR orders.

24

Risk Bot and Trade Register

Execution history helps reconcile the context of a position.

Risk Bot relies on IBKR position data to verify quantities and can reconcile entry-price references with available trade history, including Trade Register records. The register supports traceability but does not replace the positions and open orders actually reported by IBKR.

This distinction matters when a stock is reentered quickly: the code treats historical entry references cautiously to avoid confusing a previous trade’s entry price with the current holding.

25

Trading Mode NONE and PAPER/LIVE environments

Blocking new entries does not stop protection of existing holdings.

With Trading Mode NONE, Entry Bot does not open new positions, while Risk Bot must continue supervising holdings already in the account. Monitoring and analysis components retain their separate responsibilities.

The same Managed VPS can use the IBKR PAPER or LIVE environment selected in Control Center. Protection concepts are the same, but PAPER results do not guarantee live-market execution. Customers should confirm the active environment before any sensitive action.

26

When protections cannot be confirmed

Problems must remain visible and diagnosable.

Several events can delay or prevent safe order management: IBKR disconnection, a still-active BUY, unstable quantity, unreliable entry price, contradictory Intraday classification, unconfirmed OCA cancellation, rejected protective orders or unavailable market data.

The program must not hide such events behind an artificial “protected” label. It may remain pending, report a critical incident or request IBKR verification. The right response is not a forced restart or manual overlapping SELL orders without first reconciling existing holdings and orders.

27

Five practical situations

Applying Risk Bot behavior to understandable examples.

A

Partially filled BUY

The purchase is still executable: Risk Bot waits for the final position quantity before constructing the TP/SL pair.

B

Trailing trigger reached

Swing L1 triggers: TP/SL cancellation is confirmed before the new trailing order is submitted.

C

Restart during the session

Risk Bot recovers holdings and protection orders from IBKR instead of assuming its previous local state was correct.

D

Uncertain Intraday stop

Contradictory classification blocks an automatic rebuild rather than guessing a Swing stop value.

E

Partial exit

Position quantity decreases: reconciliation reduces the risk of keeping SELL protections for too many shares.

28

What customers can check

Observe and document before requesting intervention.

If something looks wrong, first verify the selected account and environment, IBKR connectivity, Risk Bot under Core Bots → Risk, recent protection messages and the open orders associated with the stock.

  1. Record the symbol, approximate time and actual quantity held.
  2. Note whether a BUY was still active, a trailing trigger had fired or cancellation was pending.
  3. Compare the displayed status with IBKR open orders; do not infer protection from a chart alone.
  4. Open a Web Portal support ticket if facts disagree or protection cannot be verified.

On a Managed VPS, technical interventions and repair procedures should remain coordinated with SB-ITM.

29

Actions not to improvise

Do not turn a protection incident into an execution incident.

Avoid directly editing classification records, internal settings, SELL orders or VPS scripts. Do not repeatedly restart Risk Bot or Entry Bot to silence an error. Do not manually remove an OCA order without knowing which related SELL orders are still live.

A holding that appears temporarily unprotected requires prompt investigation, but the correct response depends on actual IBKR order states and whether an emergency operation is underway. Use Web Portal → Support for coordinated assistance.

30

What Risk Bot cannot guarantee

Automated protection does not eliminate market risk.

Risk Bot automates protection placement, reconciliation and updates, but depends on information and confirmations received from IBKR. Network interruptions, trading halts, sharp price moves or insufficient liquidity may affect when and how orders execute.

A stop order does not guarantee an exact exit price; a take-profit limit does not guarantee a counterparty; trailing stops do not eliminate slippage. Automation improves operational discipline but does not replace risk awareness and incident monitoring.

31

Frequently asked questions

Essential distinctions for safe SB-ITM operation.

A purchase filled: is protection immediately active?

Not necessarily. Risk Bot must confirm the final share quantity and verify accepted protective orders.

The market regime changes: do all my stops move immediately?

No. Regime, configured levels and existing live orders are different concepts, with separate update logic.

Can an Intraday holding use Swing levels L1–L4?

No. Intraday uses its own single-level trailing mechanism.

Should Risk Bot stop when Trading Mode is NONE?

No. Blocking new entries does not remove the need to protect existing positions.

Is a chart screenshot enough proof of protection?

No. When protection is in question, verify the actual broker orders.