Administrator
3 hours ago 1278ee2bd43b401489b4377b0eee5259b3d5bbbb
src/main/java/com/xcong/excoin/modules/okxApi/OkxTradeExecutor.java
@@ -48,15 +48,17 @@
    private final String contract;
    private final String marginMode;
    private final String accountName;
    private final String instIdCode;
    private volatile WebSocketClient wsClient;
    private final ExecutorService executor;
    public OkxTradeExecutor(String contract, String marginMode, String accountName) {
    public OkxTradeExecutor(String contract, String marginMode, String accountName, String instIdCode) {
        this.contract = contract;
        this.marginMode = marginMode;
        this.accountName = accountName;
        this.instIdCode = instIdCode;
        this.executor = new ThreadPoolExecutor(
                1, 1,
                60L, TimeUnit.SECONDS,
@@ -171,7 +173,7 @@
                JSONArray argsArray = new JSONArray();
                JSONObject args = new JSONObject();
                args.put("instId", contract);
                args.put("instIdCode", instIdCode);
                args.put("tdMode", marginMode);
                args.put("side", side);
                args.put("posSide", posSide);
@@ -218,7 +220,7 @@
                }
                JSONArray argsArray = new JSONArray();
                JSONObject args = new JSONObject();
                args.put("instId", contract);
                args.put("instIdCode", instIdCode);
                args.put("algoOrdType", "conditional");
                argsArray.add(args);
@@ -248,7 +250,7 @@
    private JSONObject buildOrderArgs(TradeRequestParam param) {
        JSONObject args = new JSONObject();
        args.put("instId", param.getInstId());
        args.put("instIdCode", instIdCode);
        args.put("tdMode", param.getTdMode());
        args.put("clOrdId", param.getClOrdId());
        args.put("side", param.getSide());
@@ -274,7 +276,6 @@
        String connId = OkxWsUtil.getOrderNum("order");
        JSONObject msg = OkxWsUtil.buildJsonObject(connId, "order", argsArray);
        wsClient.send(msg.toJSONString());
        log.info("[TradeExec] 发送下单: side={}, sz={}", param.getSide(), param.getSz());
    }
    private void sendBatchOrders(List<TradeRequestParam> params) {