Skip to content

Scenarios: create, set status, halt and resume trading

Goal: register a scenario (a market world, a portfolio and a strategy), make it the one in use, pause or archive it, and stop and resume its trading — one scenario with h, or every scenario at once with the kill switch K.

A scenario lives in cfg.scenario.<ID>. Its status (active, paused, archived) is a registry field and stops no orders. Its trading halt (sc.<ID>.trading.halt) is what stops trading: its strategies withhold their orders and its executors refuse them. LIVE is the reserved production scenario.

Prerequisites

Create

  1. Open Scenario: Trading top tab, 9 (Scenario) in the default layout.
  2. Press a. In Add Scenario fill in:
    • Scenario ID — upper case A-Z0-9_, at most 32 characters, e.g. CRISIS_TEST_1 (not LIVE).
    • Scenario name — optional (defaults to the id).
    • Market world, Portfolio world, Strategy world — act or hyp.
    • Market universe — e.g. ALL (required).
    • Strategy id — optional: (none) or one of the existing strategies.
  3. Press Add. Toast: Added scenario '<ID>'.

Use it

Highlight the row and press Enter. Toast: Active scenario set to '<ID>'; the Trading context row names it, and it is saved in the TUI's state for the next start.

Set status

Key Effect
space active → paused (asks Pause scenario '<ID>'?); paused → active (no question).
x Archive (asks: It becomes read-only.).
d Delete (asks twice; LIVE cannot be deleted).

Halt and resume one scenario

  1. Highlight the scenario, press h.
  2. Confirm Halt trading of '<ID>'? .... Open orders stay (the kill switch cancels them).
  3. The Trading column shows HALTED (<reason>); the context row says HALTED: <scenarios> on every tab.
  4. To resume: h again on the row, confirm Resume trading of '<ID>'? ....

Kill switch: halt everything

  1. Press K on any tab (or ctrl+p → the kill switch).
  2. The TUI lists what it will do and asks twice (a protected context does not ask a third time).
  3. It halts every scenario that is not archived, then sends cancel-all to every running executor (a worker serving a sc.<S>.trading.order.submitted topic), which cancels the open orders the platform placed (LiveExecutor: the vf- orders at Binance).
  4. A report lists the scenarios halted and, per executor, the orders canceled and what failed.

Nothing resumes by itself: resume each scenario with h on Trading › Scenario.

What you should see

  • Rows with ID, Status, Trading, Market, Portfolio, Strategy.
  • Halts and resumes as halt rows on Infra › Alerts.

Troubleshooting

Symptom Cause and fix
Scenario ID must be uppercase A-Z0-9_ (max 32 chars) / Scenario ID 'LIVE' is reserved Choose another id.
Enter a market universe (e.g. ALL) The universe is required.
Cannot pause/resume a archived scenario Archived scenarios are read-only.
Scenario 'LIVE' is reserved and cannot be deleted By design.
Orders still go out after space Pausing changes the status only; halt with h or K.
Open orders remain after h A halt keeps open orders; K cancels them, or cancel at the venue.

From the AI tab: scenarios__add, scenarios__setStatus, scenarios__halt, scenarios__resume, scenarios__delete. The kill switch is for people only: the AI has no tool for it (The TUI's API). Reference: Keybindings › Scenario and Kill switch.