Skip to main content

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​

ModeSet withEffect
Frozen accountPOST /tw/accounts/mode/freezeNew orders and modifies are rejected (account is in frozen mode). Cancels still work.
Closing-only accountPOST /tw/accounts/mode/closing-onlyOnly position_effect: close orders are accepted (account is in close-only mode).
Inactive end customerPOST /tw/accounts/ec/statusNew orders and modifies for that end customer are rejected (client is in frozen mode).
Closing-only end customerPOST /tw/accounts/ec/statusOnly 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_codeMessageCause
DisallowedOrderAction_Errormarket is closedA market order, or an order from a non-TWD account, outside 09:00 – 13:30 Taipei time
BasicInput_Errorinvalid trading session combination for this markettrading_session_ids other than TW2, TW3 or both
BasicInput_ErrorTaiwanese stock routing through TWSDP currently requires cash accountsOrder from a margin account
BasicInput_ErrorTaiwanese stock order requires a TW securitySymbol is not a Taiwanese equity
BasicInput_Errorinvalid time_in_forcetime_in_force other than day
BasicInput_Errororder quantity exceeds maximum allowable (999,999)Quantity above the maximum
BasicInput_Errorfar side has no quoteMarket buy with no ask available
AccountBalancesPositions_Errorinsufficient cash to buyNot enough cash_available for the reservation
AccountBalancesPositions_Errorsell to close quantity exceeds long positionSelling more shares than you hold
Instrument_Errorsecurity not foundUnknown symbol
DisallowedOrderAction_Errororder ineligible to be canceled or modifiedModifying a working order outside 09:00 – 13:30
DisallowedOrderAction_Errororder in terminal state cannot be canceled or modifiedThe order is already filled, canceled, replaced or rejected

See TW Trading for how error codes map to HTTP status codes.