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
- An active context (Switch context).
- For a strategy leg: the strategy exists (Compose a strategy).
Create¶
- Open Scenario: Trading top tab,
9(Scenario) in the default layout. - Press
a. In Add Scenario fill in:- Scenario ID — upper case
A-Z0-9_, at most 32 characters, e.g.CRISIS_TEST_1(notLIVE). - Scenario name — optional (defaults to the id).
- Market world, Portfolio world, Strategy world —
actorhyp. - Market universe — e.g.
ALL(required). - Strategy id — optional:
(none)or one of the existing strategies.
- Scenario ID — upper case
- 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¶
- Highlight the scenario, press
h. - Confirm
Halt trading of '<ID>'? .... Open orders stay (the kill switch cancels them). - The Trading column shows
HALTED (<reason>); the context row saysHALTED: <scenarios>on every tab. - To resume:
hagain on the row, confirmResume trading of '<ID>'? ....
Kill switch: halt everything¶
- Press
Kon any tab (orctrl+p→ the kill switch). - The TUI lists what it will do and asks twice (a protected context does not ask a third time).
- It halts every scenario that is not archived, then sends
cancel-allto every running executor (a worker serving asc.<S>.trading.order.submittedtopic), which cancels the open orders the platform placed (LiveExecutor: thevf-orders at Binance). - 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
haltrows 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.