Trade/Full Margin Contract
Description: Contract full position trading order group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.addMarketOrder
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Game ID, should be filled with 1 for this game
Account ID, optional. If filled, trading will be conducted with this account
Business type, 1-Market price open; 2-Market price close; 10-Limit price pending order; 11-Stop loss pending order; 12-Limit price open
Order buy/sell direction, 1-Buy; 2-Sell;
Product ID, product ID
Position ID, required when placing a closing order
Order request time, 13-digit timestamp
Price at the time of order placement, needs to be multiplied by 10 to the power of 'product price decimal places', converted to an integer for input. Only for order recording, not the actual transaction price.
Order quantity
Stop loss unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.
Take profit unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.
Expiration type, only valid for pending orders. 1-Valid for the day; 2-Valid for the week; 3-30 days; 4-90 days; Default 2
Remarks
Account currency
Account Decimal Places
Leverage ratio, only valid for opening positions, there should only be one leverage ratio for the same product
H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (limited to 255 characters, enumeration is for reference only,Only letters, numbers, and underscores can be used)
(limited to 255 characters,Only letters, numbers, and underscores can be used)
Only market orders are valid. It can be a percentage (only supports 2 decimal places, rounding off any excess) or a floating-point type that only supports 4 decimal places, rounding off any excess). Other formats are not supported.
POST /api/global/tradeapi.app.CfdMMOrderApiService.addMarketOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 330
{
"tradeType": 1,
"accountId": 1,
"bizType": 1,
"direction": 1,
"symbolId": 1,
"positionId": 1,
"requestTime": 1,
"requestPrice": "text",
"requestNum": "text",
"stopLoss": "text",
"takeProfit": "text",
"expireType": 1,
"remark": "text",
"accountCurrency": "text",
"accountDigits": 1,
"crossLevelNum": 1,
"source": "text",
"thirdPartyOrder": "text",
"slippage": "text"
}{
"msg": "Success",
"fail": false,
"trace": "x-dqxq8-qu20y7y-dq58lhn-39i483-1677570581",
"code": "0",
"data": {
"tradeVolume": "0.1",
"symbolId": 720,
"orderId": 14460002,
"fee": "-0.0668",
"openOrClose": 1,
"openPrice": "22.25",
"takeProfit": "0",
"positionId": 2023022819810,
"interest": "0",
"openDirection": 1,
"stopLoss": "0",
"executePrice": "22.25",
"digits": 2,
"symbolName": "BINAN_SOL_USDT",
"profit": "0",
"direction": 1
},
"bizCode": "",
"tm": 162,
"msgParams": null,
"ok": true
}group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.updatePboOrder
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
Optional. If filled, trading will be conducted with this account
Needs to be multiplied by 10 to the power of 'product quote decimal places', processed as an integer and passed in.
Needs to be multiplied by 10 to the power of 'product quote decimal places', processed as an integer and passed in.
POST /api/global/tradeapi.app.OrderApiService.updatePboOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 108
{
"tradeType": 22,
"pboId": "63",
"requestPrice": 16,
"takeProfit": 57,
"accountId": 98,
"stopLoss": 18,
"requestNum": 35
}{
"msg": "Success",
"fail": false,
"trace": "x-dqxq8-qu20y7y-dq58lhn-39i483-1677570581",
"code": "0",
"data": {
"tradeVolume": "0.1",
"symbolId": 720,
"orderId": 14460002,
"fee": "-0.0668",
"openOrClose": 1,
"openPrice": "22.25",
"takeProfit": "0",
"positionId": 2023022819810,
"interest": "0",
"openDirection": 1,
"stopLoss": "0",
"executePrice": "22.25",
"digits": 2,
"symbolName": "BINAN_SOL_USDT",
"profit": "0",
"direction": 1
},
"bizCode": "",
"tm": 162,
"msgParams": null,
"ok": true
}Explanation: Set position stop loss and take profit group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.updateOrder
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
Account ID, must fill in either account currency
Account currency, must fill in either account ID
Order ID
Position ID
Account Decimal Places
Stop loss unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.
Take profit unit price, need to multiply by 10 to the power of 'product quote decimal places', and process it as an integer input.
Remarks
POST /api/global/tradeapi.app.CfdMMOrderApiService.updateOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 153
{
"tradeType": 1,
"accountId": 1,
"accountCurrency": "text",
"orderId": 1,
"positionId": 1,
"accountDigits": 1,
"stopLoss": "text",
"takeProfit": "text",
"remark": "text"
}{
"msg": "Account balance is 0",
"fail": true,
"trace": "x-0ei175a-x4dh9u2-1g8s95r-m2708212-1677570735",
"code": "E000031",
"data": "tradeapi.app.OrderApiService.updateOrder",
"bizCode": "CFD",
"tm": 7,
"msgParams": null,
"ok": false
}Explanation: Query historical closing records
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryHistoryCloseOrderList
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
pnl-Profit; openTime-Opening time; closeTime-Closing time; orderId-Order ID; symbolId-Product ID;
desc-Descending order; asc-Ascending order;
13-digit timestamp
13-digit timestamp
13-digit timestamp
13-digit timestamp
Default 1
Default 20
H5: mobile web; PC_Web: pcweb; System: system; Android: Android native app; iOS: Apple native app; HOS: Hongmeng OS; PC_Win: pcwindows client; PC_Mac: pcmac client; default is the same as login source. (The enumeration is for reference only)
POST /api/global/tradeapi.app.CfdMMOrderApiService.queryHistoryCloseOrderList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 220
{
"tradeType": 1,
"accountId": 1,
"sortFieldName": "text",
"sortType": "text",
"symbolId": 1,
"openStartTime": 1,
"openEndTime": 1,
"closeStartTime": 1,
"closeEndTime": 1,
"current": 1,
"size": 1,
"querySource": "text",
"thirdPartyOrder": "text"
}{
"msg": "Success",
"fail": false,
"trace": "x-77q3ivej-u4wi1d3a-5pbl5v-ypwj0-1677573497",
"code": "0",
"data": {
"accountId": null,
"trace": "x-77q3ivej-u4wi1d3a-5pbl5v-ypwj0-1677573497",
"companyId": 360,
"current": 1,
"size": 20,
"totalPage": 0,
"ip": "47.242.92.158",
"customerId": 1176,
"list": [],
"lang": "en-US",
"totalPnl": 0,
"customerNo": "86001175"
},
"bizCode": "",
"tm": 6,
"msgParams": null,
"ok": true
}Description: Contract-full position gameplay, set the customer's leverage multiplier for the product, affecting all positions of the product
group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.setCrossLevelNum
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
POST /api/global/tradeapi.app.CfdMMOrderApiService.setCrossLevelNum HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 128
{
"tradeType": 1,
"companyId": 1,
"customerId": 1,
"customerNo": "text",
"customerGroupId": 1,
"symbolId": 1,
"requestTime": 1,
"trace": "text"
}{
"msg": "Success",
"fail": false,
"trace": "x-6s8tc-2v65-i8270878-1727-1677574098",
"code": "0",
"data": {
"crossLevelNum": 11
},
"bizCode": "",
"tm": 17,
"msgParams": null,
"ok": true
}Explanation: Calculate margin and commission for placing orders group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.calculateMarketOrder
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
Optional. If filled, trading will be conducted with this account
1-Market price open; 2-Market price close; 10-Limit price pending order; 11-Stop loss pending order; 12-Limit price open
1-Buy; 2-Sell;
Required when placing a closing order
13-digit timestamp
For order record only, not the actual transaction price*
Only valid for pending orders. 1-Valid for the day; 2-Valid for the week;
Only valid for opening positions, only one leverage ratio should be set for the same product
POST /api/global/tradeapi.app.CfdMMOrderApiService.calculateMarketOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 233
{
"tradeType": 1,
"accountId": 1,
"bizType": 1,
"direction": 1,
"symbolId": 1,
"positionId": 1,
"requestTime": 1,
"requestPrice": "text",
"requestNum": "text",
"expireType": 1,
"remark": "text",
"accountCurrency": "text",
"accountDigits": 1,
"crossLevelNum": 1
}{
"msg": "Success",
"fail": false,
"trace": "x-7rf727-m64d8ar-72dn4ij-23o3vt-1677574738",
"code": "0",
"data": {
"margin": "10000.6584",
"calculatePrice": "136.719",
"fee": "0.0000"
},
"bizCode": "",
"tm": 31,
"msgParams": null,
"ok": true
}Description: Query position details
group=tradeApi version=0.0.1 bizType=tradeapi.app.PositionApiService.queryPositionDetail
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
POST /api/global/tradeapi.app.CfdMMPositionApiService.queryPositionDetail HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 44
{
"tradeType": 1,
"accountId": 1,
"positionId": 1
}{
"msg": "Success",
"fail": false,
"trace": "x-11wdkt-kg9i-ld2y-53mz854-1677571927",
"code": "0",
"data": {
"symbolId": 720,
"orderId": 14460003,
"dealId": 94870543,
"canReduceMargin": "0.0000",
"openPrice": "22.18",
"remark": null,
"takeProfitDecimal": "0.00",
"closeNum": 0,
"closeFee": "0.0000",
"takeProfit": "0",
"occupyTheMargin": "0.0000",
"interest": "0.0000",
"maintenanceMargin": "0.0000",
"closeVolume": 0,
"openVolume": 0.1,
"closeTime": 0,
"closeAccountDigits": 4,
"symbolName": "BINAN_SOL_USDT",
"openTime": 1677571033093,
"profit": null,
"tradeType": 1,
"direction": 1,
"singleMargin": null,
"margin": null,
"openContractSize": 1,
"resp": null,
"openMargin": "0.2209",
"openNum": 0.1,
"openFee": "0.0665",
"closeSymbolDigits": 2,
"warningMargin": "0.0000",
"stopLossDecimal": "0.00",
"adjustCrossLevel": "1-100",
"openSymbolDigits": 2,
"volume": 0.1,
"accountId": 1031767,
"companyId": 360,
"positionId": 2023022819827,
"closeFreeDigits": null,
"stopLoss": "0",
"minVolume": null,
"marginSetType": "2",
"crossLevelNum": 10,
"openAccountDigits": 4,
"closePrice": "0.0000",
"status": "1"
},
"bizCode": "C",
"tm": 27,
"msgParams": null,
"ok": true
}Explanation: Pagination query account capital flow group=tradeApi version=0.0.1 bizType=tradeapi.app.OrderApiService.queryCapitalFlowList
{{company}}{{LoginResult.data.token}}en-UStradeApi{{mock_trace}}0.0.1Should be filled with 1 under this gameplay
0-Unrestricted; 1-Deposit; 2-Withdrawal; 3-System reset; 4-Limit adjustment; 5-Freeze; 6-Transaction; 36-Transfer; 42-Reward;
0-Unrestricted; 1-Initialization; 2-Processing successful; 3-Processing failed;
13-digit timestamp
13-digit timestamp
0-Unrestricted; 1-Increase; 2-Decrease;
POST /api/global/tradeapi.app.CfdMMOrderApiService.queryCapitalFlowList HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 143
{
"tradeType": 1,
"accountId": 1,
"size": 1,
"current": 1,
"businessType": 1,
"status": 1,
"startTime": 1,
"endTime": 1,
"operate": 1,
"assetsId": 1,
"lang": "text"
}{
"msg": "System error",
"fail": true,
"trace": "x-q7pj-8jiln-310518-4l0c69-1677572511",
"code": "500",
"data": "tradeapi.app.OrderApiService.queryCapitalFlowList",
"bizCode": "TA",
"tm": 0,
"msgParams": null,
"ok": false
}Last updated