Administrator
2026-06-02 85e1673c4683f4699106afe79405877903ce4eb5
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxTradeExecutor.java
@@ -86,7 +86,7 @@
     * @param onFailure 失败回调
     */
    public void openLong(String quantity, Consumer<String> onSuccess, Runnable onFailure) {
        submitOrder("buy", "long", quantity, "market", null, false, "t-okx-grid-long", onSuccess, onFailure);
        submitOrder("buy", "long", quantity, "market", null, false, "tGridLong", onSuccess, onFailure);
    }
    /**
@@ -97,7 +97,7 @@
     * @param onFailure 失败回调
     */
    public void openShort(String quantity, Consumer<String> onSuccess, Runnable onFailure) {
        submitOrder("sell", "short", quantity, "market", null, false, "t-okx-grid-short", onSuccess, onFailure);
        submitOrder("sell", "short", quantity, "market", null, false, "tGridShort", onSuccess, onFailure);
    }
    /**
@@ -219,11 +219,9 @@
        }
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                params.put("algoId", algoId);
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", params, HttpMethod.POST, okxAccount.isSimluate());
                String body = "[{\"instId\":\"" + instId + "\",\"algoId\":\"" + algoId + "\"}]";
                String resp = okxAccount.requestHandler.sendSignedRequestRaw(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", body, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 条件单已取消, algoId:{}", algoId);
                if (onSuccess != null) {
                    onSuccess.accept(algoId);
@@ -240,10 +238,9 @@
    public void cancelAllAlgoOrders() {
        executor.execute(() -> {
            try {
                LinkedHashMap<String, Object> params = new LinkedHashMap<>();
                params.put("instId", instId);
                String resp = okxAccount.requestHandler.sendSignedRequest(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", params, HttpMethod.POST, okxAccount.isSimluate());
                String body = "[{\"instId\":\"" + instId + "\",\"instType\":\"SWAP\"}]";
                String resp = okxAccount.requestHandler.sendSignedRequestRaw(
                        okxAccount.baseUrl, "/api/v5/trade/cancel-algos", body, HttpMethod.POST, okxAccount.isSimluate());
                log.info("[OkxExec] 已尝试清除条件单, resp:{}", resp);
            } catch (Exception e) {
                log.error("[OkxExec] 清除条件单失败", e);