Amend Orders with ‘aq’, ‘ap’, and ‘asp’

2020-06-24 3 mins read

Bitwise Terminal 2.4 adds three new commands to amend orders in bulk: aq (amend quantity), ap (amend price), and asp (amend stop price).

Each command takes an amendment argument followed by one or more order filters:

Amendment commands only affect open orders of the current contract that match any of the order filters, which can be a list of order IDs or ID prefixes with at least two characters each. You may also filter all buy orders with b, all sell orders with s, or all open orders with a.

<amended-quantity>, <amended-price>, and <amended-stop-price> can be either an absolute value or a relative change with a + or - prefix.

Let’s work through a few examples to show how the commands can help boost your efficiency.

Suppose you have the following five open orders:

Initial open orders

Initial open orders

Example #1: Increase the quantity of the stop market order by 500.

You may use the relative notation as in aq +500 be1 (“be1” being a prefix of the order ID “be14f3e”). Alternatively, you may mentally do the math (1000 + 500) and pass in an absolute value (i.e. aq 1500 be1). Absolute values are always positive for both long and short orders.

Quantity abbreviations such as k (1,000) and m (1,000,000) are accepted by aq, too.

Example #2: Reduce all sell orders’ quantity by 50%.

What would normally be a laborious task can be done in one go with the command aq -50% s.

Note that you can’t change a sell order to a buy order without canceling it first (and vice versa).

Amend quantity with &lsquo;aq&rsquo;

Amend quantity with ‘aq’

The following is what you get after executing the previous two aq commands:

Open orders with amended quantities

Open orders with amended quantities

Example #3: Shift all sell prices upward by 200.

Order prices can be similarly adjusted in bulk using the relative change notation: ap +200 s.

Example #4: Set order 38f1114’s price to 5% above the lowest ask price on the orderbook.

“5% above the lowest ask” can be denoted as a+5% (see relative price notation for details). The full command is thus ap a+5% 38f. Bitwise Terminal will calculate the adjusted price and round it to the nearest tick size.

Amend price with &lsquo;ap&rsquo;

Amend price with ‘ap’

All four limit sell prices have been updated as shown below.

Open orders with amended prices

Open orders with amended prices

Example #5: Increase the stop price of order be14f3e by 99.5

Adjusting the stop price of an order is almost identical to setting its limit price, except that you run the asp command rather than ap.

Amend stop price with &lsquo;asp&rsquo;

Amend stop price with ‘asp’

Final result:

Open orders with amended stop price

Open orders with amended stop price

As of today, amendment commands are only accessible from the command line. Please use them carefully as they are executed immediately without confirmation.