Using the Option Defense desktop app interface
First launch & activation
Goal: Activate the app on this device using your onboarding token.
What you see
- A modal titled “Option Defense Activation” with the header “🔑 Activation Required”.
- A single input field for the token plus Activate and Cancel buttons.

Steps
- Launch the app.
- Paste the onboarding token from your email.
- Click Activate (or press Enter).
- If the token is invalid, an error appears and the dialog stays open.
Scan positions (collapsed/expanded)
Goal: Review existing option positions quickly.
What you see
- Each position is a collapsible header.
- Line 1: arrow (▶/▼), status emoji, symbol, option type, strike, expiry.
- Line 2: Qty, option P&L (color-coded), optional stock P&L, premium.
Behavior
- Active strategies expand by default.
- Click the header to expand/collapse details.

Configure the hedge rules
Goal: Define entry and stop‑loss logic for this position.
Fields
- Position Size
- Invert entry/exit (reverse hedge)
- Entry Trigger Price
- Entry Execution Price
- Stop‑Loss Trigger Price
- Stop‑Loss Execution Price
Hedging logic by option type
- CALL → entry action is BUY stock; if Invert is on, entry action becomes SELL.
- PUT → entry action is SELL stock; if Invert is on, entry action becomes BUY.
- Entry order type is STP LMT using Entry Trigger (auxPrice) and Entry Execution (lmtPrice).
- Quantity = Position Size × 100 shares.
Order lifecycle
- Entry fills → place stop‑loss exit as STP LMT with Stop‑Loss Trigger/Execution.
- Exit action is always the opposite of entry (SELL if BUY, BUY if SELL).
- Exit fills → reset and place a new entry order (cycle continues).
Validation rules
- All fields required; position size must be > 0.
- Entry/exit prices must align with direction:
- BUY entry → execution ≥ trigger
- SELL entry → execution ≤ trigger
- SELL exit → stop‑loss execution ≤ trigger
- BUY exit → stop‑loss execution ≥ trigger
- Entry trigger and stop‑loss trigger must not overlap.
Errors are shown inline next to the fields:

Start, pause, and save a strategy (per position)

Start
- Appears when no active strategy is running.
- If validation fails, an inline error appears: “⚠ Fix X error(s) before starting.”
Pause
- Appears when a strategy is active.
Save
- Appears only when an active strategy has unsaved changes.
- Updates active orders if the strategy is not paused.

Start All / Pause All
Start All
- Enabled when at least one configured position is not active or is paused.
- If all are active, the app shows: “All configured positions already have active strategies.”
Pause All
- Pauses all active, unpaused strategies.
Closing with active orders
If active orders exist, a confirmation dialog appears with:
- Cancel Orders (cancel & close)
- Keep Orders (close without canceling)
- Close (X) → Don’t close

Connection to IBKR
Goal: Update the IBKR API port and reconnect without restarting.
What you see
- Port field in the toolbar.
- Save & Reconnect appears only after you change the value.
- If the connection drops, a full-screen overlay: “Connection Lost to IB”.
- Message: “All actions are blocked until connection is restored.”
- Progress bar and reconnect status.
- Port input + Change & Reconnect button.
Steps (connected)
- Edit the port number.
- Click Save & Reconnect.
- The app validates the input (numeric, 1024 to 65535).
- The app reconnects and reloads the session.
Steps (connection lost)
- Wait for automatic retries.
- If needed, change the port and click Change & Reconnect.

License warning (grace period)
If license validation fails but is non‑fatal, a banner appears: “⚠️ License validation failed. Running in grace period…”
The app allows up to 24 hours of grace before showing a fatal error.

Update notifications
Manual check: toolbar → Check Updates.
If an update is available, a dialog shows:
- Current → latest version
- Release notes
- Update Now / Later

