| | |
| | | } |
| | | |
| | | public static final String ORDERWS_CHANNEL = "order"; |
| | | public static final String BATCH_ORDERSWS_CHANNEL = "batch-orders"; |
| | | |
| | | public static void orderEvent(WebSocketClient webSocketClient, TradeRequestParam tradeRequestParam) { |
| | | |
| | |
| | | } |
| | | |
| | | JSONArray argsArray = new JSONArray(); |
| | | JSONObject args = new JSONObject(); |
| | | for (TradeRequestParam tradeRequestParam : tradeRequestParams){ |
| | | String accountName = tradeRequestParam.getAccountName(); |
| | | String markPx = tradeRequestParam.getMarkPx(); |
| | |
| | | * 平空:买入平空(side 填写 buy; posSide 填写 short ) 需要检验仓位通道是否准备就绪 |
| | | */ |
| | | |
| | | JSONObject args = new JSONObject(); |
| | | args.put("instId", instId); |
| | | args.put("tdMode", tdMode); |
| | | args.put("clOrdId", clOrdId); |
| | |
| | | argsArray.add(args); |
| | | } |
| | | |
| | | String connId = WsParamBuild.getOrderNum(ORDERWS_CHANNEL); |
| | | JSONObject jsonObject = WsParamBuild.buildJsonObject(connId, ORDERWS_CHANNEL, argsArray); |
| | | String connId = WsParamBuild.getOrderNum(BATCH_ORDERSWS_CHANNEL); |
| | | JSONObject jsonObject = WsParamBuild.buildJsonObject(connId, BATCH_ORDERSWS_CHANNEL, argsArray); |
| | | webSocketClient.send(jsonObject.toJSONString()); |
| | | log.info("发送止盈止损下单频道:{}",argsArray); |
| | | log.info("发送止盈止损批量下单频道:{}",argsArray); |
| | | } |
| | | |
| | | |