TW Risk Limits
Every Taiwanese order is checked by Atomic Vaults when you submit it. Orders that fail a check are rejected synchronously with an HTTP 400 and an error_code. The exchange applies its own rules afterwards; a rejection there arrives as a rejected WebSocket update.
Checks Applied by Atomic Vaults
Account
Orders must come from a TWD cash account returned by GET /tw/accounts. Margin accounts are rejected.
Buying power
A buy reserves quantity × price × 1.10 from cash_available until it fills or ends. price is the limit price, or the current ask for a market order. The reserved amount appears in cash_withheld_for_buys in GET /tw/balances. A buy that needs more than the available cash is rejected with AccountBalancesPositions_Error (insufficient cash to buy).
Market orders need a quote
A market buy is priced from the current ask. If there is no ask for the symbol, the order is rejected with BasicInput_Error (far side has no quote).
Positions
A sell to close cannot exceed your long position, after shares already committed to open sell orders.
Maximum order quantity
999,999 shares per order.
Price format
Prices must be positive. Atomic Vaults does not check TWSE tick sizes, the daily price limit or the board lot; see Exchange Rules.
Duplicate order IDs
Every order_id and replacement_order_id must be unique. A repeated ID is rejected with BasicInput_Error (received duplicate order_id (must be unique)). If a request times out, check GET /tw/orders/status before retrying with the same ID.
Account and end-customer modes
| Mode | Set with | Effect |
|---|---|---|
| Frozen account | POST /tw/accounts/mode/freeze | New orders and modifies are rejected (account is in frozen mode). Cancels still work. |
| Closing-only account | POST /tw/accounts/mode/closing-only | Only position_effect: close orders are accepted (account is in close-only mode). |
| Inactive end customer | POST /tw/accounts/ec/status | New orders and modifies for that end customer are rejected (client is in frozen mode). |
| Closing-only end customer | POST /tw/accounts/ec/status | Only position_effect: close orders for that end customer are accepted (client is in close-only mode). |
Per-account limits
Atomic Vaults can configure a daily notional limit and liquidity (average daily volume) limits for your account. They are agreed during onboarding.
Exchange Rules
These are enforced by the exchange or broker, not by Atomic Vaults. Orders that break them are accepted by the API and then rejected, and you receive a rejected WebSocket update with the reason in text.
- Tick size. Limit prices must be on the TWSE tick size for the price level.
- Daily price limit. Prices must be within ±10% of the previous close.
- Board lot. Regular-session orders trade in lots of 1,000 shares.
- Venue limits. Per-order and daily notional caps apply. Contact Atomic Vaults for the limits on your account.
Common Rejections
error_code | Message | Cause |
|---|---|---|
DisallowedOrderAction_Error | market is closed | A market order, or an order from a non-TWD account, outside 09:00 – 13:30 Taipei time |
BasicInput_Error | invalid trading session combination for this market | trading_session_ids other than TW2, TW3 or both |
BasicInput_Error | Taiwanese stock routing through TWSDP currently requires cash accounts | Order from a margin account |
BasicInput_Error | Taiwanese stock order requires a TW security | Symbol is not a Taiwanese equity |
BasicInput_Error | invalid time_in_force | time_in_force other than day |
BasicInput_Error | order quantity exceeds maximum allowable (999,999) | Quantity above the maximum |
BasicInput_Error | far side has no quote | Market buy with no ask available |
AccountBalancesPositions_Error | insufficient cash to buy | Not enough cash_available for the reservation |
AccountBalancesPositions_Error | sell to close quantity exceeds long position | Selling more shares than you hold |
Instrument_Error | security not found | Unknown symbol |
DisallowedOrderAction_Error | order ineligible to be canceled or modified | Modifying a working order outside 09:00 – 13:30 |
DisallowedOrderAction_Error | order in terminal state cannot be canceled or modified | The order is already filled, canceled, replaced or rejected |
See TW Trading for how error codes map to HTTP status codes.