> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qfex.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enums

## OrderType

This defines how the order is executed by the engine. The WebSocket API uses the
string names below; the numeric values are the corresponding internal values.

| Name | Value | Accepted by `add_order` | Description |
| - | - | - | - |
| `LIMIT` | 0 | Yes | Limit order. |
| `MARKET` | 1 | Yes | Market order. |
| `ALO` | 3 | Yes | Add Liquidity Only order. If it would cross the book, the order is rejected. |
| `TAKE_PROFIT` | 4 | Yes | Take-profit stop order. |
| `STOP_LOSS` | 5 | Yes | Stop-loss stop order. |
| `STOP_MARKET` | 6 | No | Market order generated when a stop order triggers; it may appear in order, fill, and trade responses. |
| `TWAP_LIMIT` | 7 | No | System-generated child order for a TWAP; it may appear in order, fill, and trade responses. |

Internal value `2` is reserved for liquidation orders and is not accepted as a
client-facing `OrderType`.

## OrderDirection

This defines the direction of the order.

| Name | Value | Description |
| - | - | - |
| `BUY` | 0 | Buy order |
| `SELL` | 1 | Sell order |

## OrderTimeInForce

This defines the time in force of the order.

| Name | Description |
| - | - |
| `GTC` | Good till canceled. This order will stay in the book until it is filled or canceled. |
| `IOC` | Immediate or cancel. This order will fill as much as possible and then be canceled. If the order cannot be filled immediately, the remaining quantity will be canceled. |
| `FOK` | Fill or kill. This order will be canceled if it cannot be filled immediately. If the order cannot be filled immediately, the entire order will be canceled. |

## OrderStatus

This is returned on any order response. This will indicate the current status of the order.

| Name | Description |
| - | - |
| `ACK` | Order accepted. |
| `IOC_CANCELLED` | The unfilled portion of an immediate-or-cancel order was cancelled. |
| `INVALID_PRICE` | Invalid price. |
| `INVALID_QUANTITY` | Invalid quantity. |
| `NOT_FOUND` | Requested order was not found. |
| `IOC_PARTIALLY_FILLED` | Immediate-or-cancel order was partially filled and the remainder cancelled. |
| `USER_NOT_FOUND` | User was not found. |
| `PERMISSION_DENIED` | User is not permitted to perform this action. |
| `FILLED` | Order filled, this could be partially filled. |
| `MODIFIED` | Order successfully modified. |
| `CANCELLED` | Order successfully cancelled. |
| `CANCELLED_STP` | Order cancelled by self trade prevention. |
| `REJECTED` | Order rejected |
| `NO_SUCH_ORDER` | Cancel rejected, no such order exists. |
| `INVALID_ORDER_TYPE` | Invalid order type. |
| `BAD_SYMBOL` | Invalid symbol. |
| `PRICE_LESS_THAN_MIN_PRICE` | Price less than minimum price for this symbol. |
| `PRICE_GREATER_THAN_MAX_PRICE` | Price greater than maximum price for this symbol. |
| `CANNOT_MODIFY_NO_SUCH_ORDER` | Failed to modify this order. Order does not exist. |
| `CANNOT_MODIFY_PARTIAL_FILL` | Cannot modify partially filled order. Please cancel your current order and place a new order. |
| `CANNOT_MODIFY_ALO_WOULD_CROSS` | Cannot modify an ALO order which would cause it cross the market. |
| `FAILED_MARGIN_CHECK` | Failed margin check. Please check your available balance. |
| `REJECTED_MUST_CHANGE_VALUE_MODIFY` | Modify request did not change a required value. |
| `NO_CHANGE_NO_UPDATE` | No values changed, so the order was not updated. |
| `INVALID_TICK_SIZE_PRECISION_PRICE` | Invalid tick size for this symbol. Check the price tick size in the reference data. |
| `INVALID_TICK_SIZE_PRECISION_QUANTITY` | Invalid lot size for this symbol. Check the lot size in the reference data. |
| `QUANTITY_LESS_THAN_MIN_QUANTITY` | Quantity less than minimum for this symbol. Check the minimum quantity in the reference data. |
| `QUANTITY_GREATER_THAN_MAX_QUANTITY` | Quantity greater than maximum for this symbol. Check the maximum quantity in the reference data. |
| `REJECTED_GREATER_THAN_MAX_PRICE_BAND` | Price is above the permitted price band. |
| `REJECTED_LESS_THAN_MIN_PRICE_BAND` | Price is below the permitted price band. |
| `INVALID_TIME_IN_FORCE` | Invalid time in force for this order type. |
| `REJECTED_WOULD_BREACH_MAX_POSITION` | Order would breach the maximum position limit. |
| `REJECTED_WOULD_BREACH_MAX_NOTIONAL` | Would breach max notional limits. |
| `REJECTED_MARKET_CLOSED` | QFEX is currently not accepting orders for this symbol. |
| `USER_IN_LIQUIDATION` | User is currently being liquidated. |
| `REJECTED_FAILED_TO_PROCESS` | Failed to process order. |
| `INVALID_TAKE_PROFIT_PRICE` | Invalid take-profit price. |
| `INVALID_STOP_LOSS_PRICE` | Invalid stop-loss price. |
| `INVALID_CLIENT_ORDER_ID` | Client order ID is invalid. |
| `RATE_LIMITED` | You have sent too many requests to trade.qfex.com. Please contact [support@qfex.com](mailto:support@qfex.com) to raise your limits. |
| `REJECTED_TOO_MANY_OPEN_ORDERS` | You have reached the max number of open orders. |
| `REJECTED_OPEN_INTEREST_LIMIT` | You have reached the max Open Interest limit for a given symbol. |
| `REJECTED_TOTAL_OPEN_INTEREST_LIMIT` | Order would breach the total open-interest limit. |
| `REJECTED_LESS_THAN_MIN_NOTIONAL` | Order notional is below the permitted minimum. |

## SymbolStatus

| Name | Description |
| - | - |
| `ACTIVE` | Symbol is active. |
| `INACTIVE` | Symbol is temporarily suspended. |
| `DELISTED` | Symbol is permanently suspended. |

## CandlesInterval

Use the wire value when subscribing to the WebSocket candle channel. The
symbolic name is the corresponding internal enum name.

| Wire value | Symbolic name | Description |
| - | - | - |
| `1MIN` | `ONE_MINUTE` | 1 minute candle. |
| `5MINS` | `FIVE_MINUTES` | 5 minute candle. |
| `15MINS` | `FIFTEEN_MINUTES` | 15 minute candle. |
| `30MINS` | `THIRTY_MINUTES` | 30 minute candle. |
| `1HOUR` | `ONE_HOUR` | 1 hour candle. |
| `4HOURS` | `FOUR_HOURS` | 4 hour candle. |
| `1DAY` | `ONE_DAY` | 1 day candle. |

## ExecutionType

| Name | Description |
| - | - |
| `NEW` | User placed order. |
| `LIQUIDATION` | Forced liquidation by QFEX. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.