Skip to main content

Sizing & prices

The grammar that fills <size> and <price> slots in every trading command.


Size

FormMeaning
$1000USD notional, prefix form
1000$USD notional, suffix form
50%Percent — scope depends on command class (see below)
50%balExplicit percent of free balance
50%posExplicit percent of open position

Default percent scope

Bare 50% doesn't mean the same thing for every command:

Command classDefault scope
buy / sell / scale / swarm / chase (entries)balance
close / stop (exits)position

Use %bal or %pos explicitly when you want to override.

Bare numbers are rejected

buy 100 # ❌ "USD or % required"
buy $100 # ✅
buy 100$ # ✅
buy 0.01 BTC # ✅ — 0.01 is interpreted as raw contracts when no other size shape matches

The rejection of bare integers ≥ 100 is deliberate — it stops a typo like buy 100 from coercing to a market order with notional ambiguity. Source: TradingBaseCommand.ts.

tokenLooksLikeNonSymbol filter

Tokens that already parse as size or percent ($100, 100$, 50%) are filtered out of fuzzy symbol matching before the parser ever tries to resolve a market. This stops 1000$ from being absorbed when an exchange happens to have a base symbol of "1000" (some Binance memecoin pairs).

Source: TradingBaseCommand.ts:282-301.

Inverse contracts

For inverse markets (BitMEX XBTUSD, Bybit inverse, Bitget inverse, …) sizing uses notional ÷ contractSize instead of notional ÷ price. contractSize defaults to 1 and should be populated by the exchange adapter for venues with non-1 contract sizes (Binance Coin-M, Deribit, …).

Source: TradingBaseCommand.ts:166-208.


Price

FormMeaning
50000Absolute price
+100 / -100Relative offset (added to last)
1% / -0.5%Percent offset (anchor × (1 + pct/100))
$anchorConstant — $entry, $last, etc.
$anchor +N / +N% / -N%Anchor with inline offset

See Variables for the full list of price anchors and which ones support inline offsets.


Trailing modifiers

Per-command modifier vocabulary. All are optional and most can stack.

ModifierUsed byEffect
at <price>buy, sellConvert to limit at given price
stop <price>buy, sellBracketed stop loss attached to the entry
trigger <abs-price>stop (paired with at)Limit-stop — trigger differs from limit
to <length>chaseTerminate-at distance (abs / N% / $N / N$)
into <N>scale, swarm, twapSlice count
over <minutes>twapTime horizon
from <p1> to <p2>scale, cancelPrice range (scale: ladder; cancel: filter)
reducebuy, sell, scale, swarm, chase, twap (parsed)Reduce-only
pobuy, sell (limit only)Post-only — see Workflow → set po
bestbuy, sellLimit at best bid (buy) / best ask (sell)
takerscaleDrop the default post-only TIF
irregularswarmRandomise slice weights in [0.5x..1.5x]
chasertwapRun a chaser per slice
keepchase cancelStop chaser but leave the resting order
last / top / bottom / firstcancel, bumpSort-and-pick selectors
from <p1> to <p2>cancelPrice-range filter (limits only)

Putting it together

A few full sentences to anchor the grammar:

buy $100 at $bid +0.1% post-only reduce
chase sell %all% 20% reduce to 1%
scale buy $1000 into 10 from -0.25% to -1% reduce
twap chase buy $500 into 5 over 30 reduce timeout 30% next fail next
cancel buys ro from 49000 to 50000

If a sentence parses, the result lines up with the table above. If it doesn't, drop one modifier and try again — the parser bails fast on ambiguity rather than guessing.