Compose a strategy¶
Goal: combine existing strategies into a composite strategy
(cfg.strategy.<NAME>, {components}), or add an atomic one from the registry.
Prerequisites
- Signed in as an admin.
- The target context is active; on a protected context each write asks first.
- At least two known strategies: atomic ones are workers tagged
type(the registry's New strategy worker… creates one), composite ones are already composed.
Steps¶
- Open Trading > Strategy (route
/trading/strategy). The table lists every strategy: Name, Kind (atomicorcomposite), Detail, Status. - Optional: a new atomic strategy. New strategy worker… opens New worker from the
registry (see Start a worker); the worker is tagged
type=<its name>. Start it from Infra > Workers. - Compose… The dialog Compose a strategy opens.
- Name: upper-case, e.g.
MOMENTUM_MIX. - Components: tick at least two, in the order you want them (N chosen, in the order picked).
- Compose. The composite is saved as
cfg.strategy.<NAME>.
To remove one: select it, Remove…. A composite loses only its entry (its components stay); an atomic one's worker is deleted. The dialog warns when other composites use it (Used by …: they will name a strategy that is gone.).
What you should see¶
- A new row, Kind
composite, Detail listing its components. - Infra > Changes: Compose strategy
<NAME>. - The scenario's strategy leg may name it (Trading > Scenario, Add… → Strategy id).
Troubleshooting¶
| Symptom | Cause and fix |
|---|---|
| Compose… disabled | Fewer than two known strategies, or you are not an admin. |
| Name: an upper-case identifier (letters, digits, _; at most 32) | Use e.g. MOMENTUM_MIX. Composing under an existing composite's name replaces its components. |
| Pick at least 2 components | Tick two or more. |
Composing <NAME> from … would make a cycle |
A composite cannot contain itself, directly or through another composite. |
| An atomic strategy is missing | Its worker has no type tag: tag it on Infra > Workers (Tag…, key type). |
More: Views > Strategy.