# YBX Trading API > REST and WebSocket API for programmatic trading on Yellow Box Markets MT5 accounts. Binance-style conventions, native MT5 semantics. Every page of this documentation is available as Markdown: append `.md` to its URL (the landing page is `/index.md`). [llms-full.txt](/llms-full.txt) holds every page in one file. The API is pre-release — read Known Limitations before testing against a live server. ## Getting started - [Introduction](/index.md): REST and WebSocket API for programmatic trading on Yellow Box Markets MT5 accounts. - [Use with AI agents](/ai-agents.md): This documentation is also published for AI coding agents: Markdown pages, an llms.txt index, and an Agent Skill. - [Change Log](/changelog.md): Version history - [Known Limitations](/known-limitations.md): Pre-release: where the current trade server falls short of the contract, and what to do meanwhile - [General Info](/general-info.md): Base URLs, authentication and signing (worked example), the login parameter model, rate limits, HTTP status codes, error shape, data conventions, versioning policy - [Common Definition](/common-definition.md): Every enum, with its MT5 integer, and the mt5RetCode table - [Error Codes](/error-codes.md): Every error code by family, with exact msg text ## Market Data - [Market Data Overview](/market-data.md): ping, time, exchangeInfo, tickers, klines, recent ticks - [Test connectivity (NONE)](/market-data/test-connectivity.md): GET /v1/ping — Tests connectivity to the REST API. - [Check server time (NONE)](/market-data/check-server-time.md): GET /v1/time — Returns the API server's clock. - [Exchange information (NONE)](/market-data/exchange-information.md): GET /v1/exchangeInfo — Trading rules, symbol specifications and the live rate limits. - [Symbol price ticker (MARKET_DATA)](/market-data/symbol-price-ticker.md): GET /v1/ticker/price — Latest quote for a symbol, or for every symbol. - [Symbol order book ticker (MARKET_DATA)](/market-data/symbol-order-book-ticker.md): GET /v1/ticker/bookTicker — Best bid/ask. - [24hr ticker statistics (MARKET_DATA)](/market-data/24hr-ticker-statistics.md): GET /v1/ticker/24hr — Daily statistics from the trade server's tick statistics. - [Klines (candlestick data) (MARKET_DATA)](/market-data/klines-candlestick-data.md): GET /v1/klines — Historical candles. - [Recent ticks (MARKET_DATA)](/market-data/recent-ticks.md): GET /v1/ticks — The most recent ticks for a symbol. ## Trade - [Order Lifecycle](/trade.md): Order lifecycle (read this first), place / modify / cancel orders, positions, batch orders - [New order (TRADE)](/trade/new-order.md): POST /v1/order — Opens a market position or places a pending order. - [Modify pending order (TRADE)](/trade/modify-pending-order.md): PUT /v1/order — Changes a resting pending order. - [Cancel pending order (TRADE)](/trade/cancel-pending-order.md): DELETE /v1/order — Cancel pending order - [Query order (USER_DATA)](/trade/query-order.md): GET /v1/order — The current state of one order. - [Current pending orders (USER_DATA)](/trade/current-pending-orders.md): GET /v1/openOrders — Every pending order currently resting on the account. - [All orders (USER_DATA)](/trade/all-orders.md): GET /v1/allOrders — Order history, including filled, cancelled and expired orders. - [Open positions (USER_DATA)](/trade/open-positions.md): GET /v1/positions — Every open position on the account. - [Modify position SL/TP (TRADE)](/trade/modify-position-sltp.md): PUT /v1/position — Sets the stop loss and take profit on an open position. - [Close position (TRADE)](/trade/close-position.md): DELETE /v1/position — Closes an open position, fully or partially, at market. - [Close all open positions (TRADE)](/trade/close-all-open-positions.md): DELETE /v1/allOpenPositions — Closes every open position on the account, optionally filtered to one symbol. - [Place multiple orders (TRADE)](/trade/place-multiple-orders.md): POST /v1/batchOrders — The burst primitive. ## Account - [Account Overview](/account.md): Account state, the logins a key may trade, deal history - [Account information (USER_DATA)](/account/account-information.md): GET /v1/account — Balance, equity and margin for one MT5 account, as the trade server reports them. - [Accounts in key scope (USER_DATA)](/account/accounts-in-key-scope.md): GET /v1/accounts — Every MT5 login this API key may trade. - [Account trade list (USER_DATA)](/account/account-trade-list.md): GET /v1/userTrades — Executed deals for the account. ## User Data Streams - [User Data Streams Overview](/user-data-streams.md): Connect with a listenKey, every account event, ordering and reconnect rules - [Start user data stream (USER_STREAM)](/user-data-streams/start-user-data-stream.md): POST /v1/listenKey — Creates a listenKey, or returns the key's existing one. - [Keepalive user data stream (USER_STREAM)](/user-data-streams/keepalive-user-data-stream.md): PUT /v1/listenKey — Extends the listenKey by 60 minutes from the moment of the call. - [Close user data stream (USER_STREAM)](/user-data-streams/close-user-data-stream.md): DELETE /v1/listenKey — Invalidates the listenKey and closes every WebSocket connection using it. - [Event: DEAL](/user-data-streams/deal.md): An execution. - [Event: ORDER_UPDATE](/user-data-streams/order_update.md): A pending order was added, changed or removed. - [Event: POSITION_UPDATE](/user-data-streams/position_update.md): A position was opened, changed or closed. - [Event: ACCOUNT_UPDATE](/user-data-streams/account_update.md): The account's realised balance or credit changed — a fill settling, a deposit, a withdrawal, a credit grant, a commission or swap posting. - [Event: listenKeyExpired](/user-data-streams/listenkeyexpired.md): The listenKey lapsed. ## WebSocket Market Streams - [WebSocket Market Streams Overview](/websocket-market-streams.md): Connect, subscribe protocol, limits, every market stream - [Tick stream](/websocket-market-streams/tick-stream.md): The primary price feed: one message per quote update from the trade server. - [Book ticker stream](/websocket-market-streams/book-ticker-stream.md): Best bid and ask, Binance-shaped. - [Kline streams](/websocket-market-streams/kline-streams.md): Live candles are built from the tick stream as it arrives. - [Individual symbol ticker stream](/websocket-market-streams/individual-symbol-ticker-stream.md): Daily statistics, the same data as GET /v1/ticker/24hr, throttled to at most one message per second per symbol. - [Symbol depth stream](/websocket-market-streams/symbol-depth-stream.md): Level-2 market depth from the trade server's order book. ## Optional - [OpenAPI contract](/openapi.yaml): Machine-readable OpenAPI 3.1 contract for the REST surface. - [Agent Skill (zip)](/ybx-trading-api-skill.zip): The ybx-trading-api Agent Skill — SKILL.md plus reference files generated from these docs. - [Agent Skill instructions](/agent-skill/SKILL.md): The skill's SKILL.md on its own. - [Full documentation](/llms-full.txt): Every page above, in order, in one Markdown file.