| Next revision | Previous revision |
| developers:admin:tradehalt [2026/10/09 13:40] – created chad | developers:admin:tradehalt [2026/10/09 14:09] (current) – chad |
|---|
| A trading halt window halts trading for a firm at a set time and resumes it at a later time. Windows can run once or repeat on a schedule, and can optionally liquidate the firm when the halt starts. | A trading halt window halts trading for a firm at a set time and resumes it at a later time. Windows can run once or repeat on a schedule, and can optionally liquidate the firm when the halt starts. |
| |
| All endpoints require admin rights. | |
| |
| | **Method** | **Path** | **Description** | | | **Method** | **Path** | **Description** | |
| | DELETE | ''/admin/v1/firms/{firmID}/trading-halt-windows/{windowID}'' | Delete a halt window. | | | DELETE | ''/admin/v1/firms/{firmID}/trading-halt-windows/{windowID}'' | Delete a halt window. | |
| | GET | ''/admin/v1/firms/{firmID}/trading-halt-windows/{windowID}/executions'' | List the halt and open actions taken for a window. | | | GET | ''/admin/v1/firms/{firmID}/trading-halt-windows/{windowID}/executions'' | List the halt and open actions taken for a window. | |
| | |
| | |
| | [[https://api-sim.t4login.com/admin/swagger/index.html|Admin API Swagger Documentation]] |
| |
| ===== Halt Window Fields ===== | ===== Halt Window Fields ===== |
| | repeat | Optional. Days to repeat on, as the three cron day fields: ''day-of-month month day-of-week''. Omit for a one-time window. | | | repeat | Optional. Days to repeat on, as the three cron day fields: ''day-of-month month day-of-week''. Omit for a one-time window. | |
| | timeZone | Required. IANA time zone that ''haltTime'', ''openTime'' and ''repeat'' are evaluated in, e.g. ''America/Chicago''. | | | timeZone | Required. IANA time zone that ''haltTime'', ''openTime'' and ''repeat'' are evaluated in, e.g. ''America/Chicago''. | |
| | notificationUrl | Optional. HTTPS webhook (e.g. Google Chat) notified when each halt and open runs. | | | notificationUrl | Optional. Your HTTPS webhook, called after each halt and open runs. See [[#notifications|Notifications]]. | |
| |
| ==== One-Time vs Repeating ==== | ==== One-Time vs Repeating ==== |
| | ''* * 0,6'' | Saturday and Sunday | | | ''* * 0,6'' | Saturday and Sunday | |
| | ''1 * *'' | The 1st of every month | | | ''1 * *'' | The 1st of every month | |
| | |
| |
| ===== Create a Halt Window ===== | ===== Create a Halt Window ===== |
| "repeat": "* * 1-5", | "repeat": "* * 1-5", |
| "timeZone": "America/Chicago", | "timeZone": "America/Chicago", |
| "notificationUrl": "https://chat.googleapis.com/v1/spaces/.../messages?..." | "notificationUrl": "https://hooks.example.com/t4/trading-halt" |
| } | } |
| </code> | </code> |
| "repeat": "* * 1-5", | "repeat": "* * 1-5", |
| "timeZone": "America/Chicago", | "timeZone": "America/Chicago", |
| "notificationUrl": "https://chat.googleapis.com/v1/spaces/.../messages?...", | "notificationUrl": "https://hooks.example.com/t4/trading-halt", |
| "nextExecutionTime": "2026-10-12T15:55:00-05:00" | "nextExecutionTime": "2026-10-12T15:55:00-05:00" |
| }, | }, |
| | status | ''Completed'', ''Failed'', ''Skipped'' (missed and too late to run), or ''Executing''. | | | status | ''Completed'', ''Failed'', ''Skipped'' (missed and too late to run), or ''Executing''. | |
| | message | Error or skip reason, when there is one. | | | message | Error or skip reason, when there is one. | |
| | |
| | |
| | ===== Notifications ===== |
| | |
| | When ''notificationUrl'' is set, T4 sends a ''POST'' with a JSON body to it after every halt and open, whether it succeeded or not. Respond with any ''2xx'' status. Non-''2xx'' responses and timeouts (10 seconds) are retried up to 4 more times with increasing delays. |
| | |
| | ''jobId'' is the ''tradingHaltTimeWindowId'' of the window that ran. ''taskName'' is ''Halt <firm>'' or ''Open <firm>''. |
| | |
| | Success: |
| | |
| | <code> |
| | { |
| | "taskId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", |
| | "jobId": "3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e0f2a31", |
| | "taskName": "Halt Acme Trading", |
| | "executionId": "0b5d3a2e-91f4-4c8a-b6e7-2d4f8a1c9e30", |
| | "status": "Completed", |
| | "scheduledTimeUtc": "2026-10-12T20:55:00Z", |
| | "startedUtc": "2026-10-12T20:55:00.120Z", |
| | "completedUtc": "2026-10-12T20:55:01.480Z", |
| | "durationMs": 1360, |
| | "attempts": 1, |
| | "httpStatus": 200 |
| | } |
| | </code> |
| | |
| | Failure: |
| | |
| | <code> |
| | { |
| | "taskId": "7c9e6679-7425-40de-944b-e07fc1f90ae7", |
| | "jobId": "3f2b8c1e-6a4d-4e2f-9b7a-1c5d8e0f2a31", |
| | "taskName": "Halt Acme Trading", |
| | "executionId": "5f1c8e7a-2b3d-4e6f-9a0b-c4d5e6f7a8b9", |
| | "status": "Failed", |
| | "scheduledTimeUtc": "2026-10-13T20:55:00Z", |
| | "startedUtc": "2026-10-13T20:55:00.095Z", |
| | "completedUtc": "2026-10-13T20:55:42.310Z", |
| | "durationMs": 42215, |
| | "attempts": 4, |
| | "httpStatus": 503, |
| | "error": "Service Unavailable" |
| | } |
| | </code> |
| | |
| | | **Field** | **Description** | |
| | | jobId | The ''tradingHaltTimeWindowId'' of the window that ran. | |
| | | status | ''Completed'', ''Failed'', or ''Skipped'' (missed and too late to run). | |
| | | attempts | Number of times T4 tried the halt or open. | |
| | | httpStatus | Status of the last attempt to change the firm's trading state. Omitted if no response was received. | |
| | | error | Why the last attempt failed. | |
| | | reason | Why the action was skipped, e.g. ''GraceExpired''. | |
| |
| ===== Errors ===== | ===== Errors ===== |