Enums & Constants
Enum types and constants in Python SDK 3.3.2
This page lists the SDK's enums and constants (the page name transport-classes is a legacy name; the content is Enums). All enums are imported from ssi_sdk.enums:
from ssi_sdk.enums import OrderSide, OrderType, OrderStatus, Board, AccountType, Timeframefrom_value
Every enum that extends BaseEnum (all except Timeframe, which is a plain Enum) has a classmethod from_value(value) that converts a value to a member safely: it accepts None (returns None), an existing member, the raw value, or a name/value in any letter case; if nothing matches it returns None and does not raise.
from ssi_sdk.enums import OrderStatus
OrderStatus.from_value("ff") # OrderStatus.FILLED
OrderStatus.from_value("unknown") # NoneTimeframe has no from_value; use Timeframe("1m") or pass the string straight to methods that take an interval.
OrderSide
| Value | Code | Description |
|---|---|---|
BUY | "B" | Buy |
SELL | "S" | Sell |
OrderType
price is required for LO and PLO; market-priced order types ignore price.
| Value | Code | Description |
|---|---|---|
LO | "LO" | Limit Order |
MTL | "MTL" | Market To Limit (HOSE): a market order whose unfilled part becomes a limit order |
MP | "MP" | Market Price (HNX/UPCOM) |
ATO | "ATO" | At The Open, matched in the opening auction |
ATC | "ATC" | At The Close, matched in the closing auction |
MOK | "MOK" | Match Or Kill (HNX): fill completely at once or cancel |
MAK | "MAK" | Match And Kill (HNX): fill what is possible at once, cancel the rest |
PLO | "PLO" | Post-close limit order, traded in the session after the closing auction |
OrderStatus
| Value | Code | Description |
|---|---|---|
PENDING | "PD" | Pending |
PENDING_APPROVAL | "WA" | Waiting for approval |
READY | "RS" | Ready |
SENT | "SD" | Sent |
QUEUED | "QU" | Queued |
FILLED | "FF" | Fully filled |
PARTIAL_FILLED | "PF" | Partially filled |
PARTIAL_CANCELLED | "FFPC" | Partially filled + cancelled remainder |
PENDING_MODIFY | "WM" | Pending modification |
PENDING_CANCEL | "WC" | Pending cancellation |
CANCELLED | "CL" | Cancelled |
REJECTED | "RJ" | Rejected (by the server or the exchange) |
EXPIRED | "EX" | Expired |
PRE_SESSION | "IAV" | Waiting for its session |
SOI | "SOI" | Reported by the order engine (the SDK names it after its code) |
PAS | "PAS" | Reported by the order engine (the SDK names it after its code) |
CPL | "CPL" | Reported by the order engine (the SDK names it after its code) |
REQUESTED | "RQ" | Request received (FCO engine) |
ERROR | "ERR" | Error reported by the engine |
SOI, PAS and CPL have only a code and no business description in the SDK; do not infer what they mean.
Board
| Value | Code | Description |
|---|---|---|
HOSE | "HOSE" | HOSE exchange |
HNX | "HNX" | HNX exchange |
UPCOM | "UPCOM" | UPCOM exchange |
DERIVATIVES | "DERIVATIVES" | Derivatives. Only valid on the stream (subscribe_board) and master data |
MarketFlagMessage.board returns the code DER for derivatives, not DERIVATIVES.
AccountType
| Value | Code | Description |
|---|---|---|
EQUITY | "Cash" | Equity account |
EQUITY_MARGIN | "Margin" | Margin account |
DERIVATIVE | "Derivative" | Derivative account |
Timeframe
Timeframe is a plain Enum (no from_value).
| Value | Code | Description |
|---|---|---|
MINUTE_1 | "1m" | 1 minute |
MINUTE_3 | "3m" | 3 minutes |
MINUTE_5 | "5m" | 5 minutes |
MINUTE_15 | "15m" | 15 minutes |
HOUR_1 | "1h" | 1 hour |
DAY_1 | "1d" | 1 day |
WEEK_1 | "1w" | 1 week |
MONTH_1 | "1M" | 1 month |
Not every member works everywhere:
ALLOWED_TIMEFRAMES(same module) is the set of intervals REST accepts:1d,1m,3m,5m,15m,1h.1wand1Mexist in the enum, butget_ohlc_1week_historicalandget_ohlc_1month_historicalalways raiseValidationError(code 400210); thedownload_ohlc_*methods raiseNotImplementedError. See Services, section 3.1.- On the stream only tick,
1mand5mare available (see Services, section 6.7.3).
FCOType
Conditional order type (Flexible Conditional Order).
| Value | Code | Description |
|---|---|---|
GTD | "gtd" | Good Till Date |
STOP | "stop" | Stop Market |
STOP_LIMIT | "stop_limit" | Stop Limit |
TRAILING_STOP | "trailing_stop" | Trailing Stop Market |
TRAILING_STOP_LIMIT | "trailing_stop_limit" | Trailing Stop Limit |
OCO | "oco" | One Cancels the Other |
BULL_BEAR | "bullbear" | Bull Bear order |
FCOOperator
Comparison operator used to trigger Stop / Stop Limit orders.
| Value | Code | Description |
|---|---|---|
GREATER | "greater" | Greater than (>) |
GREATER_OR_EQUAL | "greater_or_equal" | Greater than or equal (>=) |
LESSER | "lesser" | Less than (<) |
LESSER_OR_EQUAL | "lesser_or_equal" | Less than or equal (<=) |
EQUAL | "equal" | Equal (=) |
FCOStatus
Processing status of a conditional order. The status change history comes from get_fco_status_history (model FCOStatusHistoryItem, see Models).
| Value | Code | Description |
|---|---|---|
INIT | "INIT" | Newly created |
WAIT | "WAIT" | Waiting to trigger |
TRI | "TRI" | Triggered |
TRIT | "TRIT" | Triggered successfully |
TER | "TER" | Terminated |
FIS | "FIS" | Finished |
WC | "WC" | Pending cancel |
EXP | "EXP" | Expired |
ERR | "ERR" | Error |
Streaming enums
The SDK uses these enums to build topics and recognise messages; you usually do not need them directly.
| Enum | Values | Description |
|---|---|---|
StreamingMethod | subscribe, unsubscribe, ping_pong, list_subscription | Request method (the server compares case-insensitively) |
StreamingChannel | DATA, HEARTBEAT, TRADING | Stream channel |
StreamingType | orderEvent, orderMatchEvent, clientPortfolioEvent | data.eventType of trading events |
DataTopic | quote., trade., oddlot., market., indexsummary., room., put. | Market data topic prefix |
DataType | quote, trade, oddlot, market, room, put, indexsummary | Data kind (no trailing dot) |
Messages you receive: Services, section 6; models: Models: Streaming Messages.
Enums and constants elsewhere
ServerErrorCode(the server's application error codes) andHTTPStatusalso live inssi_sdk.enums, see Exceptions.ConnectionEvent(the stream connection event; not exported at top level, import it fromssi_sdk.transport.reconnect): see Services, section 6.9.- Limit constants (for example
MAX_CLIENT_REQUEST_ID_LENGTH= 20,MAX_BATCH_ORDERS= 20): see Models: Constants.