Time SeventeenDocs

Order commands

Byte-level encoding of Time Seventeen order commands — new order, cancel, amend, cancel all and withdrawal request — carried in signed frames.

A command body is the first field of every signed frame. All integers are little-endian.

New order (tag 10) — 64 bytes

OffsetFieldTypeValue
0tagu810
1idu64account × 2^32 + local
9accountu32your account
13marketu32market id
17flagsu8bit 0 NO outcome · bit 1 sell · bit 2 post-only · bit 3 reduce-only
18kindu80 limit · 1 market · 2 market-to-limit · 3 stop · 4 stop-limit · 5 trailing stop · 6 pegged
19trigger / trail / peg referenceu320 for limit
23peg offseti320 for limit
27time in forceu80 GTC · 1 IOC · 2 FOK · 3 GFD · 4 GTD
28GTD expiryu64Unix ms for GTD, else 0
36priceu32ticks, own outcome
40qtyu64contracts
48display qtyu640 = all visible (iceberg otherwise)
56OCO siblingu64order id or 0

Start with limit orders

The web terminal and the quickstart send kind 0 (limit) only: a market order is a limit order at the touch plus your slippage, with IOC. The other kinds are executed by the engine and available over FIX; their REST use is supported but less tested.

Cancel (tag 11) — 13 bytes

tag u8 = 11 · account u32 · id u64

Amend (tag 12) — 25 bytes

tag u8 = 12 · account u32 · id u64 · price u32 · qty u64

qty is the new remaining quantity. Lowering it at the same price keeps time priority; any price change re-queues the order.

Cancel all (tag 13) — 13 bytes

tag u8 = 13 · account u32 · market u64 — market 0 cancels in every market, otherwise market id + 1.

Withdrawal request (tag 21) — 21 bytes

tag u8 = 21 · account u32 · id u64 · amount u64 (ticks)

Moves free cash into a pending withdrawal that the operator pays out (testnet: no real payout).

Example

Buy 10 YES in market 3 at 42 ticks, GTC, account 7, local id 1 (from the test vectors):

0a 0100000007000000 07000000 03000000 00 00 00000000 00000000 00 0000000000000000
2a000000 0a00000000000000 0000000000000000 0000000000000000