원클릭으로
bitmex-order-types
BitMEX order types, execInst modifiers, and TIF options with practical examples.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
BitMEX order types, execInst modifiers, and TIF options with practical examples.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Price, funding, liquidation, and balance alerts using polling and WebSocket on bitmex-cli.
Autonomy progression for bitmex-cli agents: from read-only market data to autonomous fund management.
Delta-neutral basis trading between BitMEX perpetuals and fixed-date futures: entry, monitoring, and exit.
Dollar cost averaging on bitmex-cli: testnet-first, fixed qty per interval, limit orders, and position cap enforcement.
Error category handling, duplicate order prevention, retry logic, and partial fill management for bitmex-cli.
Minimize trading fees on bitmex-cli: maker vs taker, post-only orders, commission tiers, and fee audit.
| name | bitmex-order-types |
| version | 1.0.0 |
| description | BitMEX order types, execInst modifiers, and TIF options with practical examples. |
| metadata | {"openclaw":{"category":"finance"},"requires":{"bins":["bitmex"]},"depends":["bitmex-shared"]} |
BitMEX supports seven order types, several execInst modifiers, and four time-in-force values. Always use --validate before live submission.
Posts to the order book. Earns maker rebate when filled passively.
bitmex order buy XBTUSD 100 --price 50000 --order-type Limit --validate -o json 2>/dev/null
bitmex order buy XBTUSD 100 --price 50000 --order-type Limit -o json 2>/dev/null
Fills immediately at best available price. Pays taker fee. Avoid when possible.
bitmex order buy XBTUSD 100 --order-type Market --validate -o json 2>/dev/null
Triggered market order. Submits a market order when stopPx is reached.
# Stop loss: sell if price drops to 48000
bitmex order sell XBTUSD 100 --order-type Stop --stop-px 48000 \
--exec-inst ReduceOnly --validate -o json 2>/dev/null
Triggered limit order. When stopPx is touched, places a limit at --price.
bitmex order sell XBTUSD 100 --order-type StopLimit \
--stop-px 48000 --price 47900 --exec-inst ReduceOnly \
--validate -o json 2>/dev/null
Triggered market order when price moves to stopPx (in the favorable direction).
# Buy if price drops to 49000 (entry on dip)
bitmex order buy XBTUSD 100 --order-type MarketIfTouched --stop-px 49000 \
--validate -o json 2>/dev/null
Triggered limit order when price touches stopPx.
bitmex order buy XBTUSD 100 --order-type LimitIfTouched \
--stop-px 49000 --price 49100 --validate -o json 2>/dev/null
Tracks best bid or ask with an offset. Used for market-making.
Note: The CLI does not currently expose
--peg-offset-valueor--peg-price-typeflags. Pegged orders must be submitted via the REST API directly or viabitmex order buy --order-type Peggedwithout peg parameters (which will be rejected by the exchange until support is added).
# Validate that Pegged order type is accepted by the CLI (peg params set server-side or via raw API)
bitmex order buy XBTUSD 100 --order-type Pegged \
--validate -o json 2>/dev/null
Multiple modifiers can be combined with commas.
| Modifier | Effect |
|---|---|
ParticipateDoNotInitiate | Post-only: cancel if would take |
ReduceOnly | Never increase position size |
Close | Close entire position |
LastPrice | Trigger based on last trade price |
IndexPrice | Trigger based on index price |
MarkPrice | Trigger based on mark price (default for stops) |
# Post-only limit (maker rebate guaranteed or cancel)
bitmex order buy XBTUSD 100 --price 50000 --order-type Limit \
--exec-inst ParticipateDoNotInitiate -o json 2>/dev/null
# ReduceOnly stop: cannot flip position
bitmex order sell XBTUSD 100 --order-type Stop --stop-px 48000 \
--exec-inst ReduceOnly,MarkPrice -o json 2>/dev/null
| TIF | Behavior |
|---|---|
GoodTillCancel | Default; remains open until filled or cancelled |
ImmediateOrCancel | Fill whatever is available immediately, cancel rest |
FillOrKill | Fill entirely or cancel entirely |
Day | Expires at end of trading session |
bitmex order buy XBTUSD 100 --price 50000 --order-type Limit \
--tif ImmediateOrCancel --validate -o json 2>/dev/null
BitMEX supports paired order logic via contingencyType and a shared clOrdLinkID. The CLI does not currently expose these as flags; use the REST API for these order types.
| Type | Behavior |
|---|---|
OneCancelsTheOther | OCO: when one order fills or triggers, the linked order is cancelled |
OneTriggersTheOther | OTO: when the first order fills, the linked order becomes active |
OneUpdatesTheOtherAbsolute | OUO: amending one order propagates the change to the linked order |
Typical use: a stop-loss + take-profit pair as OCO so that one filling automatically cancels the other. These must currently be submitted directly via the BitMEX REST API with matching clOrdLinkID values.
Change price or qty on an open order without cancelling and re-placing:
ORDER_ID=$(bitmex order list --reverse --symbol XBTUSD -o json 2>/dev/null | \
jq -r '[.[] | select(.ordStatus=="New")][0].orderID')
bitmex order amend --order-id "$ORDER_ID" --price 50500 -o json 2>/dev/null
bitmex order amend --order-id "$ORDER_ID" --qty 200 -o json 2>/dev/null