Tell a running strategy a command
Changed onTells a running strategy something while it stays live, without restarting it — for a strategy that implements the engine's CommandRequestHandler. Owner only.
A command is an event, not a stored setting: it is delivered once to every execution behind the run, at the same market position, and nothing about it is written to the run's state. It is transient — a replica that restarts replays only its recent market history, so a command from before that only reaches one that was already running when it arrived. Anything the strategy needs to remember across a restart belongs in a parameter (PUT /live/{runId}/params), which does have a stored value; a command does not.
The command's text is a plain string; an optional properties object of your own choosing travels alongside it. Each entry lands as a top-level entry on the CommandRequest the handler receives — request.get("<key>") in Java, $command.<key> sugar in QTScript — no key is off limits, since the command's own text is kept separately.
Request
- Base URL: https://api.qtsurfer.net/v1
- URL: https://api.qtsurfer.net/v1/live/{runId}/commands
- Auth: HTTP bearer
Path parameters
Request body
Response
Accepted — on its way to every execution behind the run.
Changes
- info
added the new optional request property
- info
- info
endpoint added
- info