Scale Order

This section documents the scale_order action

This action is used to create a Scale Order.

  • Orders will be placed in a range of prices using limit orders

  • Used for both scaling in-or-out of a position


Example Request

This example will place 5 equal limit orders to open a long position on BTC between the price of 100,000 and 98,000 using a total size of $100 USD

{
  "action": "scale_order", 
  "coin": "BTC",
  "is_buy": true,
  "size_usd": 100,
  "start_price": 100000,
  "end_price": 98000,
  "num_orders": 5,
  "skew": 1,
  "reduce_only": false,
  "bot_id": BOT_ID,
  "api_key": "API_KEY"
}

This example will place 3 equal limit orders to close a long position on BTC between the price of 105,000 and 106,000 using 100% of current position size

{
  "action": "stop_market_order", 
  "coin": "BTC",
  "is_buy": false,
  "size_pct": 1,
  "start_price": 105000,
  "end_price": 106000,
  "num_orders": 3,
  "skew": 1,
  "reduce_only": true,
  "bot_id": BOT_ID,
  "api_key": "API_KEY"
}

coin*

This required parameter indicates which coin to use for the action.

"coin": "BTC"

You can whitelist coins allowed for trading in your Bot Settings


is_buy*

This required parameter indicates the direction of the trade.

  • True can open a Long position or close a Short position

  • False can open a Short position or close a Long position

"is_buy": true

reduce_only*

This required parameter indicates whether an order should only be used to close an existing position (true) or for both opening and closing/reducing positions. (false)

  • A value of true will only allow closing/reducing position

  • A value of false will allow both opening and closing position

"reduce_ony": true

start_price*

This required parameter indicates the price to place the first limit order.

  • A value of 100000 places the first limit order at the price 100,000

"start_price": 100000

Price must be below current coin price for long positions, and above for short positions.


end_price*

This required parameter indicates the price to place the last limit order.

  • A value of 98000 places the last limit order at the price 98,000

"start_price": 98000

Price must be below current coin price for long positions, and above for short positions.


num_orders*

This required parameter indicates the total numer of limit orders to place.

  • A value of 5 will place 5 different limit orders

"num_orders": 5

skew

This parameter indicates the size difference between the first and last limit order.

  • A value of 2 will make the last order size twice as large as the first order

  • A value of 0.5 will make the first order size twice as large as the last order

"skew": 2

Defaults to 1 if no value is specified. (equal order size)


Sizes

3 size types are available to use: size, size_usd, size_pct.

  • The size in this case represent the Total Size used across all limit orders.

  • Make sure each orders will be at least $10 of value. (i.e. total size is $100 USD, split across 5 orders, each order will be $20)

size

This parameter indicates a size in contracts.

  • A value of 0.005 is equal to 0.005 BTC

"size": 0.005

size_usd

This parameter indicates a size in USD.

  • A value of 100 is equal to $100 USD

"size_usd": 100

size_pct

This parameter indicates either a size in percentage of available balance when opening an order, or a size in percentage of current position when closing an order.

  • A value of 0.1 is equal to 10%

"size_pct": 0.1
  • When opening an order (reduce_only=false), a size_pct of 0.1 means 10% of available account balance

  • When closing an order (reduce_only=true), a size_pct of 0.1 means 10% of current position size


slippage_pct

This parameter indicates the Max. % slippage allowed for the trade to execute.

  • A value of 0.05 is equal to 5%

"slippage_pct": 0.05

Defaults to 5% when not specified


delay

This parameter indicates a number of seconds to wait before triggering the action.

  • A value of 5 is equal to a 5 seconds delay

  • Max. allowed delay is 10 seconds

"delay": 5

Last updated

Was this helpful?