Live Execution

Tell a running strategy a command

Changed on

Tells 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.

post/live/{runId}/commands

Request

  • Base URL: https://api.qtsurfer.net/v1
  • URL: https://api.qtsurfer.net/v1/live/{runId}/commands
  • Auth: HTTP bearer

Path parameters

runIdstring required

Request body

commandstring required

The command's text — non-blank.

propertiesobject

An optional map of your own choosing, alongside command. Absent means none; when given, it must be a JSON object, and command and properties are the only keys the body may carry. Each entry lands as a top-level entry on the strategy's CommandRequest — no key is off limits, since the command's own text is kept separately.

Response

Accepted — on its way to every execution behind the run.

runIdstring required
commandIdstring required

This command's own id, generated fresh for this call. A retried request is a second, distinct command — this endpoint takes no idempotency key.

effectiveAtMsinteger required

Epoch milliseconds — the market position every execution applies this command at.

Changes