合约下单

下单

post

说明:合约全仓交易下单

group=tradeApi
version=0.0.1
bizType=tradeapi.app.OrderApiService.addMarketOrder

服务器截图.png

Header parameters
companyIdstringOptionalExample: {{company}}
tokenstringOptionalExample: {{LoginResult.data.token}}
langstringOptionalExample: en-US
groupstringOptionalExample: tradeApi
tracestringOptionalExample: {{mock_trace}}
versionstringOptionalExample: 0.0.1
Body
tradeTypeinteger · longRequired

玩法ID,本玩法下应填1

accountIdinteger · longOptional

账户ID,非必填。如填,已该账户进行交易

bizTypeinteger · int32Required

业务类型,1-市价开;2-市价平;10-限价预埋单;11-停损预埋单;12-限价开

directioninteger · int32Required

订单买卖方向,1-买;2-卖;

symbolIdinteger · longRequired

产品ID,产品ID

positionIdinteger · longOptional

仓位ID,平仓下单时,必填

requestTimeinteger · longRequired

下单请求时间,13位时间戳

requestPricestringRequired

下单时价格,需乘以10的产品报价小数位次方,处理为整数传入。仅作下单记录,非成交价格。

requestNumstringRequired

下单手数

stopLossstringOptional

止损单价,需乘以10的产品报价小数位次方,处理为整数传入。

takeProfitstringOptional

止盈单价,需乘以10的产品报价小数位次方,处理为整数传入。

expireTypeinteger · int32Optional

过期类型,仅预埋单有效。1-当日有效;2-当周有效;

remarkstringOptional

备注

accountCurrencystringRequired

账户货币

accountDigitsinteger · int32Required

账户小数位

crossLevelNuminteger · int32Optional

杠杆倍数,仅开仓有效,同个产品应仅有一个杠杆倍数

Responses
200
成功
application/json
post
POST /api/global/tradeapi.app.CfdMMOrderApiService.addMarketOrder HTTP/1.1
Host: prewppc-3.cmfbl.com
Content-Type: application/json
Accept: */*
Content-Length: 271

{
  "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
}
200

成功

{
  "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
}

Last updated