Connecting code to the market
Automation is where a strategy meets reality: your code has to talk to a broker's servers reliably, all day, without a human watching. These pages explain the plumbing — REST and WebSocket APIs, authentication, rate limits, error handling, retries and scheduling — using broker-neutral concepts so you can build automation that is robust rather than merely working-on-a-good-day.
APIs & Automation: Trading automation connects your program to a broker through an API. REST APIs handle request/response actions (place order, fetch positions); WebSockets stream real-time data and updates. Robust automation requires secure authentication (API keys/tokens), respecting rate limits, handling API errors gracefully with sensible retry logic and idempotency, and reliable scheduling — so the system keeps running correctly even when the network, the broker or the data misbehaves.
Broker APIs
ConnectivityA broker API is a programmatic interface a broker exposes so that software — rather than a human clicking a screen — can fetch market data, read acco…
REST APIs
Request/responseA REST API is a request/response interface over HTTP in which each call asks a named endpoint to read or change a resource and returns exactly one st…
WebSockets
StreamingA WebSocket is a persistent, bidirectional connection over which a broker pushes real-time data — market ticks and order-status updates — to your pro…
Authentication
SecurityAuthentication is how a broker API verifies that a request genuinely comes from you and is authorised to act on your account, typically through API k…
Rate Limits
ThrottlingA rate limit is a broker-imposed cap on how many API requests you may send within a time window, enforced to protect their infrastructure, and exceed…
API Errors
ReliabilityAn API error is any response indicating a request did not complete as intended, and handling them means classifying each as transient or permanent, r…
Retry Logic
ReliabilityRetry logic is the disciplined re-attempting of failed requests using exponential backoff with jitter and a retry cap, combined with idempotency keys…
Event Streaming
StreamingEvent streaming is the continuous consumption of a sequence of events — ticks, fills, signals — where the consumer must handle ordering, at-least-onc…
Scheduling
OrchestrationScheduling is the automated triggering of trading tasks at precise times using cron or a scheduler, made market-aware through trading-hours and holid…
Automation Workflows
OrchestrationAn automation workflow is the orchestrated end-to-end daily cycle of an automated trading system — pre-market preparation, the live trading loop, pos…