Table of Contents generated with DocToc
Filters define trading rules on a symbol or an exchange.
Filters come in two forms: symbol filters and exchange filters.
The PRICE_FILTER defines the price rules for a symbol. There are 3 parts:
minPricedefines the minimumprice/stopPriceallowed; disabled onminPrice== 0.maxPricedefines the maximumprice/stopPriceallowed; disabled onmaxPrice== 0.tickSizedefines the intervals that aprice/stopPricecan be increased/decreased by; disabled ontickSize== 0.
Any of the above variables can be set to 0, which disables that rule in the price filter. In order to pass the price filter, the following must be true for price/stopPrice of the enabled rules:
price>=minPriceprice<=maxPrice- (
price-minPrice) %tickSize== 0
/exchangeInfo format:
{
"filterType": "PRICE_FILTER",
"minPrice": "0.00000100",
"maxPrice": "100000.00000000",
"tickSize": "0.00000100"
}The PERCENT_PRICE filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
In order to pass the percent price, the following must be true for price:
price<=weightedAveragePrice*multiplierUpprice>=weightedAveragePrice*multiplierDown
/exchangeInfo format:
{
"filterType": "PERCENT_PRICE",
"multiplierUp": "1.3000",
"multiplierDown": "0.7000",
"avgPriceMins": 5
}The PERCENT_PRICE_BY_SIDE filter defines the valid range for the price based on the average of the previous trades.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
There is a different range depending on whether the order is placed on the BUY side or the SELL side.
Buy orders will succeed on this filter if:
Order price<=weightedAveragePrice*bidMultiplierUpOrder price>=weightedAveragePrice*bidMultiplierDown
Sell orders will succeed on this filter if:
Order Price<=weightedAveragePrice*askMultiplierUpOrder Price>=weightedAveragePrice*askMultiplierDown
/exchangeInfo format:
{
"filterType": "PERCENT_PRICE_BY_SIDE",
"bidMultiplierUp": "1.2",
"bidMultiplierDown": "0.2",
"askMultiplierUp": "5",
"askMultiplierDown": "0.8",
"avgPriceMins": 1
}The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol. There are 3 parts:
minQtydefines the minimumquantity/icebergQtyallowed.maxQtydefines the maximumquantity/icebergQtyallowed.stepSizedefines the intervals that aquantity/icebergQtycan be increased/decreased by.
In order to pass the lot size, the following must be true for quantity/icebergQty:
quantity>=minQtyquantity<=maxQtyquantity%stepSize== 0
/exchangeInfo format:
{
"filterType": "LOT_SIZE",
"minQty": "0.00100000",
"maxQty": "100000.00000000",
"stepSize": "0.00100000"
}The MIN_NOTIONAL filter defines the minimum notional value allowed for an order on a symbol.
An order's notional value is the price * quantity.
applyToMarket determines whether or not the MIN_NOTIONAL filter will also be applied to MARKET orders.
Since MARKET orders have no price, the average price is used over the last avgPriceMins minutes.
avgPriceMins is the number of minutes the average price is calculated over. 0 means the last price is used.
/exchangeInfo format:
{
"filterType": "MIN_NOTIONAL",
"minNotional": "0.00100000",
"applyToMarket": true,
"avgPriceMins": 5
}The NOTIONAL filter defines the acceptable notional range allowed for an order on a symbol.
applyMinToMarket determines whether the minNotional will be applied to MARKET orders.
applyMaxToMarket determines whether the maxNotional will be applied to MARKET orders.
In order to pass this filter, the notional (price * quantity) has to pass the following conditions:
price * quantity<=maxNotionalprice * quantity>=minNotional
For MARKET orders, the average price used over the last avgPriceMins minutes will be used for calculation.
If the avgPriceMins is 0, then the last price will be used.
/exchangeInfo format:
{
"filterType": "NOTIONAL",
"minNotional": "10.00000000",
"applyMinToMarket": false,
"maxNotional": "10000.00000000",
"applyMaxToMarket": false,
"avgPriceMins": 5
}The ICEBERG_PARTS filter defines the maximum parts an iceberg order can have. The number of ICEBERG_PARTS is defined as CEIL(qty / icebergQty).
/exchangeInfo format:
{
"filterType": "ICEBERG_PARTS",
"limit": 10
}The MARKET_LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for MARKET orders on a symbol. There are 3 parts:
minQtydefines the minimumquantityallowed.maxQtydefines the maximumquantityallowed.stepSizedefines the intervals that aquantitycan be increased/decreased by.
In order to pass the market lot size, the following must be true for quantity:
quantity>=minQtyquantity<=maxQtyquantity%stepSize== 0
/exchangeInfo format:
{
"filterType": "MARKET_LOT_SIZE",
"minQty": "0.00100000",
"maxQty": "100000.00000000",
"stepSize": "0.00100000"
}The MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on a symbol.
Note that both "algo" orders and normal orders are counted for this filter.
/exchangeInfo format:
{
"filterType": "MAX_NUM_ORDERS",
"maxNumOrders": 25
}The MAX_NUM_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on a symbol.
"Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
/exchangeInfo format:
{
"filterType": "MAX_NUM_ALGO_ORDERS",
"maxNumAlgoOrders": 5
}The MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of ICEBERG orders an account is allowed to have open on a symbol.
An ICEBERG order is any order where the icebergQty is > 0.
/exchangeInfo format:
{
"filterType": "MAX_NUM_ICEBERG_ORDERS",
"maxNumIcebergOrders": 5
}The MAX_POSITION filter defines the allowed maximum position an account can have on the base asset of a symbol.
An account's position defined as the sum of the account's:
- free balance of the base asset
- locked balance of the base asset
- sum of the qty of all open BUY orders
BUY orders will be rejected if the account's position is greater than the maximum position allowed.
/exchangeInfo format:
{
"filterType":"MAX_POSITION",
"maxPosition":"10.00000000"
}The TRAILING_DELTA filter defines the minimum and maximum value for the parameter trailingDelta.
In order for a trailing stop order to pass this filter, the following must be true:
For STOP_LOSS BUY, STOP_LOSS_LIMIT_BUY,TAKE_PROFIT SELL and TAKE_PROFIT_LIMIT SELL orders:
trailingDelta>=minTrailingAboveDeltatrailingDelta<=maxTrailingAboveDelta
For STOP_LOSS SELL, STOP_LOSS_LIMIT SELL, TAKE_PROFIT BUY, and TAKE_PROFIT_LIMIT BUY orders:
trailingDelta>=minTrailingBelowDeltatrailingDelta<=maxTrailingBelowDelta
/exchangeInfo format:
{
"filterType": "TRAILING_DELTA",
"minTrailingAboveDelta": 10,
"maxTrailingAboveDelta": 2000,
"minTrailingBelowDelta": 10,
"maxTrailingBelowDelta": 2000
}The EXCHANGE_MAX_NUM_ORDERS filter defines the maximum number of orders an account is allowed to have open on the exchange.
Note that both "algo" orders and normal orders are counted for this filter.
/exchangeInfo format:
{
"filterType": "EXCHANGE_MAX_NUM_ORDERS",
"maxNumOrders": 1000
}The EXCHANGE_MAX_NUM_ALGO_ORDERS filter defines the maximum number of "algo" orders an account is allowed to have open on the exchange.
"Algo" orders are STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, and TAKE_PROFIT_LIMIT orders.
/exchangeInfo format:
{
"filterType": "EXCHANGE_MAX_NUM_ALGO_ORDERS",
"maxNumAlgoOrders": 200
}The EXCHANGE_MAX_NUM_ICEBERG_ORDERS filter defines the maximum number of iceberg orders an account is allowed to have open on the exchange.
/exchangeInfo format:
{
"filterType": "EXCHANGE_MAX_NUM_ICEBERG_ORDERS",
"maxNumIcebergOrders": 10000
}