Scenarios: create, set status, halt and resume trading¶
Goal: register a scenario (a market, portfolio and strategy setup, e.g. a backtest), pause, resume or archive it, halt and resume its trading, and stop all trading at once with the kill switch.
Prerequisites
- Signed in as an admin (anyone may Use a scenario).
- The target context is active; on a protected context each write asks first.
Steps: add a scenario¶
- Open Trading > Scenario (route
/trading/scenario). - Add… The dialog Add a scenario opens.
- ID: upper-case letters, digits and
_, at most 32 (e.g.BACKTEST_1); notLIVE. Name: optional (defaults to the ID). - Market: World (default
act) and Universe (defaultALL). Portfolio: World. Strategy: World and, optionally, Strategy id. - Add. The scenario is registered
active.
Steps: work in a scenario¶
- Select its row and press Use (or
Enter). The line above the table says using<ID>((real trading) forLIVE). - Trading > P&L and Trading > Risk now show that scenario (their scenario picker switches it too). The choice is per browser and per context.
Steps: pause, resume, archive¶
- Select the scenario.
- Pause… → Pause scenario
<ID>? (Its workers stop taking decisions until it is resumed.) → Yes. On a paused scenario the button is Resume. - Archive… → Archive scenario
<ID>? (It stays registered, read only; it trades no more.) → Yes.
LIVE cannot be paused, archived or deleted.
Steps: halt and resume trading¶
- Select the scenario (any,
LIVEincluded). - Halt trading… → Halt trading of
<ID>?: its strategies withhold their orders and its executors refuse them until it is resumed. Open orders stay (the kill switch cancels them). Yes. - To resume: Resume trading… → Resume trading of
<ID>? → Yes.
Steps: the kill switch¶
- Press Kill switch in the header (admins; any view).
- The dialog Kill switch on
<context>shows the plan: Halt N scenarios (every one not archived or deleted) and Cancel all orders of M executors (the running executors). - Continue, then Yes, stop trading now (Really? This stops trading on
<context>now.). On a protected context the write gate asks once more. - Read the report: halted: …, and per executor N order(s) canceled; failures in red (NOT halted …, cancel-all FAILED: …). Nothing resumes by itself: resume each scenario with Resume trading….
Steps: delete a scenario¶
- Select it, Delete…. Irreversible: it is marked deleted, taken out of the index, every
state key under
sc.<ID>.is purged, then its entry is deleted. - Type its ID into Type its ID to confirm, press Delete, then Yes, delete it.
What you should see¶
- The row's Status (
active,paused,archived) and Trading columns change at once. - A halt: the header shows
⛔ N haltedon every view; an alert trading halted: … (error), and trading resumed (info) when lifted. - Infra > Changes: each action.
Troubleshooting¶
| Symptom | Cause and fix |
|---|---|
| upper-case letters, digits and _ (at most 32) / a scenario '…' exists already / 'LIVE' is reserved | Pick another ID. |
| A scenario shows as halted though nobody halted it | Its halt key could not be read: unreadable counts as halted (safe side). Check sc.<ID>.trading.halt in Infra > States. |
| Kill switch: N executor(s) not running | They place nothing and take no command; nothing to cancel. |
| Kill switch report: cancel-all FAILED | That executor did not answer; check it in Infra > Workers and cancel at the venue if needed. |
| No Kill switch button | You are not an admin, or no context is active. |
More: Views > Scenario.