Create Orders
POST
/az/future/trade/v1/order/create
OrigQty Calculation Formula
Formula
origQty = (Balance * Percent * Leverage ) / Mark_price
Explain
Balance : (walletBalance - openOrderMarginFrozen) , api: /az/future/user/v1/compat/balance/list
Percent : user input , exp: 0.2
Leverage : leverage your want , exp: 20
Mark_price : current symobl mark price , exp: 88888 (btc_usdt)
baseCoinPrecision : decimal precision kept for origQty (base coin) , api: /az/future/market/v1/public/symbol/detail
Example
10000 * 0.2 * 20 / 88888 = 0.45 (kept to baseCoinPrecision)
Limit Flow Rules
200/s/apikey
Parameters
| Parameter | Type | Mandatory | Default | Description | Ranges |
|---|---|---|---|---|---|
| clientOrderId | string | false | N/A | Client order ID | |
| symbol | string | true | Trading pair | ||
| orderSide | string | true | N/A | Order side:BUY;SELL | BUY;SELL |
| orderType | string | true | N/A | Order type:LIMIT;MARKET | LIMIT;MARKET |
| origQty | number | true | N/A | Quantity (base) | |
| price | number | false | N/A | Price | |
| timeInForce | string | false | GTC | Valid way:GTC;IOC;FOK;GTX;RPI;GTX_SELF_CANCEL | GTC;IOC;FOK;GTX;RPI;GTX_SELF_CANCEL |
| triggerProfitPrice | number | false | N/A | Stop profit price | |
| triggerStopPrice | number | false | N/A | Stop loss price | |
| positionSide | string | true | N/A | Position side:LONG;SHORT | LONG;SHORT |
Java
public void getKLine() {
String text = HttpUtil.get(URL + "/data/api/az/future/trade/v1/getKLine?market=btc_usdt&type=1min&since=0");
System.out.println(text);
}
Response
{
"error": {
"code": "",
"msg": ""
},
"msgInfo": "success",
"result": "554845056780618880", //Order Id
"returnCode": 0
}