Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| developers:websocket:orders [2025/03/14 21:56] – chad | developers:websocket:orders [2025/03/14 22:10] (current) – chad | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== Order Routing ==== | + | ===== Order Routing |
| The WebSocket API provides real-time order routing, allowing clients to submit, revise, and pull orders. [[developers: | The WebSocket API provides real-time order routing, allowing clients to submit, revise, and pull orders. [[developers: | ||
| - | === Submitting an Order === | + | ==== Submitting an Order ==== |
| To submit an order, clients send an **OrderSubmit** message. | To submit an order, clients send an **OrderSubmit** message. | ||
| Line 37: | Line 37: | ||
| - | === Revising an Order === | + | ==== Revising an Order ==== |
| To revise an existing order, clients send an **OrderRevise** message. | To revise an existing order, clients send an **OrderRevise** message. | ||
| Line 63: | Line 63: | ||
| - | === Pulling (Cancelling) an Order === | + | ==== Pulling (Cancelling) an Order ==== |
| To cancel an order, clients must send an **OrderPull** message with the **order ID**. | To cancel an order, clients must send an **OrderPull** message with the **order ID**. | ||
| Line 87: | Line 87: | ||
| - | ==== Order Types ==== | + | ===== Order Types ===== |
| The WebSocket API supports a variety of order types to accommodate different trading strategies. Below are the supported order types, along with their corresponding **OrderSubmit** messages. | The WebSocket API supports a variety of order types to accommodate different trading strategies. Below are the supported order types, along with their corresponding **OrderSubmit** messages. | ||
| - | ---- | ||
| - | === Market Order === | + | ==== Market Order ==== |
| A Market Order executes immediately at the best available price. | A Market Order executes immediately at the best available price. | ||
| Line 117: | Line 116: | ||
| - | ---- | ||
| - | === Limit Order === | + | |
| + | ==== Limit Order ==== | ||
| A Limit Order is submitted with a specific limit price. The order will only execute at the specified price or better. | A Limit Order is submitted with a specific limit price. The order will only execute at the specified price or better. | ||
| Line 143: | Line 142: | ||
| - | ---- | ||
| - | === Stop Order === | + | |
| + | ==== Stop Order ==== | ||
| A Stop Market Order becomes a Market Order when the stop price is reached. | A Stop Market Order becomes a Market Order when the stop price is reached. | ||
| Line 169: | Line 168: | ||
| - | ---- | ||
| - | === Stop Limit Order === | + | |
| + | ==== Stop Limit Order ==== | ||
| A Stop Limit Order becomes a Limit Order when the stop price is reached. | A Stop Limit Order becomes a Limit Order when the stop price is reached. | ||
| Line 196: | Line 195: | ||
| - | ---- | ||
| - | === Trailing Stop Order === | + | |
| + | ==== Trailing Stop Order ==== | ||
| A Trailing Stop Order moves the stop price automatically based on price movement. | A Trailing Stop Order moves the stop price automatically based on price movement. | ||
| Line 223: | Line 222: | ||
| - | ---- | ||
| - | === Fill or Kill (FOK) Order === | + | |
| + | ==== Fill or Kill (FOK) Order ==== | ||
| A Fill or Kill (FOK) Order must be executed immediately in full or it is canceled. | A Fill or Kill (FOK) Order must be executed immediately in full or it is canceled. | ||
| Line 249: | Line 248: | ||
| - | ---- | ||
| - | === Immediate or Cancel (IOC) Order === | + | |
| + | ==== Immediate or Cancel (IOC) Order ==== | ||
| An Immediate or Cancel (IOC) Order executes immediately for the available quantity and cancels the rest. | An Immediate or Cancel (IOC) Order executes immediately for the available quantity and cancels the rest. | ||
| Line 275: | Line 274: | ||
| - | ---- | ||
| - | === Good Till Canceled (GTC) Order === | + | |
| + | ==== Good Till Canceled (GTC) Order ==== | ||
| A Good Till Canceled (GTC) Order remains open until it is filled or explicitly canceled. | A Good Till Canceled (GTC) Order remains open until it is filled or explicitly canceled. | ||
| Line 299: | Line 298: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | |||
| + | |||
| ==== Order Cancels Order (OCO) ==== | ==== Order Cancels Order (OCO) ==== | ||
| Line 308: | Line 310: | ||
| Example OrderSubmit message for an OCO order: | Example OrderSubmit message for an OCO order: | ||
| + | < | ||
| OrderSubmit { | OrderSubmit { | ||
| | | ||
| Line 330: | Line 333: | ||
| ] | ] | ||
| } | } | ||
| + | </ | ||
| Both orders are placed at the same time. If the Limit Order is filled, the Stop Order is automatically canceled, and vice versa. | Both orders are placed at the same time. If the Limit Order is filled, the Stop Order is automatically canceled, and vice versa. | ||
| - | ---- | + | |
| ==== AutoOCO Order ==== | ==== AutoOCO Order ==== | ||
| Line 345: | Line 350: | ||
| Example OrderSubmit message for an AutoOCO order: | Example OrderSubmit message for an AutoOCO order: | ||
| + | < | ||
| OrderSubmit { | OrderSubmit { | ||
| | | ||
| Line 374: | Line 380: | ||
| ] | ] | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | |||
| - | ---- | ||
| ==== Take Profit and Stop Loss ==== | ==== Take Profit and Stop Loss ==== | ||
| Line 383: | Line 391: | ||
| Example OrderSubmit message for a Take Profit / Stop Loss order: | Example OrderSubmit message for a Take Profit / Stop Loss order: | ||
| + | < | ||
| OrderSubmit { | OrderSubmit { | ||
| | | ||
| | | ||
| | | ||
| - | | + | |
| | | ||
| { | { | ||
| Line 412: | Line 421: | ||
| ] | ] | ||
| } | } | ||
| + | </ | ||
| When the **Trigger Order** executes, the **Take Profit** and **Stop Loss** orders are placed. If the price reaches the take profit level, the stop loss order is canceled, and vice versa. | When the **Trigger Order** executes, the **Take Profit** and **Stop Loss** orders are placed. If the price reaches the take profit level, the stop loss order is canceled, and vice versa. | ||