From 18af788eefc53c022e62ec9c683b84585e23e0aa Mon Sep 17 00:00:00 2001 From: yuanxueqi Date: Thu, 3 Sep 2020 15:48:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AB=E6=9C=88=E4=BB=BD=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 2 +- .../huobi/client/req/algo/CreateAlgoOrderRequest.java | 2 ++ .../java/com/huobi/model/account/AccountHistory.java | 2 ++ src/main/java/com/huobi/model/algo/AlgoOrder.java | 2 ++ .../com/huobi/service/huobi/HuobiAccountService.java | 9 ++++++++- .../java/com/huobi/service/huobi/HuobiMarketService.java | 3 --- 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index eef1cfef..23c4ed38 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.huobi.sdk huobi-client - 2.0.2-SNAPSHOT + 2.0.3-SNAPSHOT 1.8 diff --git a/src/main/java/com/huobi/client/req/algo/CreateAlgoOrderRequest.java b/src/main/java/com/huobi/client/req/algo/CreateAlgoOrderRequest.java index e1f4f50b..7e7a4861 100644 --- a/src/main/java/com/huobi/client/req/algo/CreateAlgoOrderRequest.java +++ b/src/main/java/com/huobi/client/req/algo/CreateAlgoOrderRequest.java @@ -37,4 +37,6 @@ public class CreateAlgoOrderRequest { private BigDecimal stopPrice; + private BigDecimal trailingRate; + } diff --git a/src/main/java/com/huobi/model/account/AccountHistory.java b/src/main/java/com/huobi/model/account/AccountHistory.java index aaa4db50..8a43f282 100644 --- a/src/main/java/com/huobi/model/account/AccountHistory.java +++ b/src/main/java/com/huobi/model/account/AccountHistory.java @@ -29,4 +29,6 @@ public class AccountHistory { private Long recordId; + private Long nextId; + } diff --git a/src/main/java/com/huobi/model/algo/AlgoOrder.java b/src/main/java/com/huobi/model/algo/AlgoOrder.java index aac3b750..e4497966 100644 --- a/src/main/java/com/huobi/model/algo/AlgoOrder.java +++ b/src/main/java/com/huobi/model/algo/AlgoOrder.java @@ -35,6 +35,8 @@ public class AlgoOrder { private BigDecimal stopPrice; + private BigDecimal trailingRate; + private Long orderOrigTime; private Long lastActTime; diff --git a/src/main/java/com/huobi/service/huobi/HuobiAccountService.java b/src/main/java/com/huobi/service/huobi/HuobiAccountService.java index fb327168..f047ff0a 100644 --- a/src/main/java/com/huobi/service/huobi/HuobiAccountService.java +++ b/src/main/java/com/huobi/service/huobi/HuobiAccountService.java @@ -113,7 +113,14 @@ public List getAccountHistory(AccountHistoryRequest request) { JSONObject jsonObject = restConnection.executeGetWithSignature(GET_ACCOUNT_HISTORY_PATH, builder); JSONArray jsonArray = jsonObject.getJSONArray("data"); - return new AccountHistoryParser().parseArray(jsonArray); + AccountHistoryParser parser = new AccountHistoryParser(); + List list = new ArrayList<>(jsonArray.size()); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject jsonItem = jsonArray.getJSONObject(i); + list.add(parser.parse(jsonItem)); + } + list.get(list.size()-1).setNextId(jsonObject.getLong("next-id")); + return list; } public AccountLedgerResult getAccountLedger(AccountLedgerRequest request) { diff --git a/src/main/java/com/huobi/service/huobi/HuobiMarketService.java b/src/main/java/com/huobi/service/huobi/HuobiMarketService.java index a1fd72f6..895988a2 100644 --- a/src/main/java/com/huobi/service/huobi/HuobiMarketService.java +++ b/src/main/java/com/huobi/service/huobi/HuobiMarketService.java @@ -417,9 +417,6 @@ public WebSocketConnection subMbpIncrementalUpdate(SubMbpIncrementalUpdateReques .checkSymbol(request.getSymbol()); int level = request.getLevels() == null ? DepthLevels.LEVEL_150.getLevel() : request.getLevels().getLevel(); - if (level != DepthLevels.LEVEL_150.getLevel()) { - throw new SDKException(SDKException.INPUT_ERROR, " Unsupport Levels : " + request.getLevels() + " incremental update only support level_150"); - } List commandList = new ArrayList<>(1); String topic = WEBSOCKET_MARKET_MBP_INCREMENT_TOPIC