Skip to content

Stop Run

Persist a stop request and submit MARKET exits for every owned position in the strategy's current run. The run finalises only after fill evidence confirms it is flat.

Endpoint URL

http
Local Host   :  POST http://127.0.0.1:5000/api/v1/strategy/stop
Ngrok Domain :  POST https://<your-ngrok-domain>.ngrok-free.app/api/v1/strategy/stop
Custom Domain:  POST https://<your-custom-domain>/api/v1/strategy/stop

Sample API Request

json
{
  "apikey": "<your_app_apikey>",
  "strategy_id": 7
}

Sample cURL Request

bash
curl -X POST http://127.0.0.1:5000/api/v1/strategy/stop \
  -H 'Content-Type: application/json' \
  -d '{
  "apikey": "<your_app_apikey>",
  "strategy_id": 7
}'

Sample API Response

json
{
  "status": "success",
  "run_id": 42,
  "stop_pending": true,
  "exits": [
    {
      "leg_id": 1,
      "ok": true,
      "position_ref": "969bc536b1c14d15992f730c2c136d7a",
      "exit_owner": "live",
      "error": null
    }
  ]
}

Request Body

ParameterDescriptionMandatory/OptionalDefault Value
apikeyYour Tradeboard API keyMandatory-
strategy_idPositive Strategy RMS idMandatory-

Response Fields

FieldTypeDescription
statusstringsuccess or error
run_idintegerCurrent run receiving the stop
stop_pendingbooleanWhether exposure still needs a fill, retry, or reconciliation
exitsarrayPer-owner exit outcomes

Exit Outcome Fields

FieldTypeDescription
leg_idintegerConfigured leg id
okbooleanWhether the exit was accepted
position_refstring or nullExact durable owner the exit targets
exit_ownerstringlive or superseded for an outgoing signal-flip owner
broker_order_idstring or nullBroker reference when one is available
errorstring or nullRefusal context when ok is false

Notes

  • stop_pending: true means the run remains open, subscribed, and managed. An accepted exit is not proof that the broker is flat.
  • A refused exit is reported with ok: false and keeps the run open and retryable. HTTP 409 can therefore still describe held exposure.
  • An entry that was accepted but is not yet filled is not exited at configured quantity, because that could create a naked position if the entry later cancels.
  • The caller never supplies a run id; the engine resolves the strategy's current run.
  • Use run_stopped in Risk Event Audit Trail or a finalised Run History row as confirmed-flat evidence.

Back to: Strategy RMS API