Skip to content

Commit

Permalink
八月份更新
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanxueqi committed Sep 3, 2020
1 parent c54bb82 commit 18af788
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.huobi.sdk</groupId>
<artifactId>huobi-client</artifactId>
<version>2.0.2-SNAPSHOT</version>
<version>2.0.3-SNAPSHOT</version>

<properties>
<java.version>1.8</java.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ public class CreateAlgoOrderRequest {

private BigDecimal stopPrice;

private BigDecimal trailingRate;

}
2 changes: 2 additions & 0 deletions src/main/java/com/huobi/model/account/AccountHistory.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ public class AccountHistory {

private Long recordId;

private Long nextId;

}
2 changes: 2 additions & 0 deletions src/main/java/com/huobi/model/algo/AlgoOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class AlgoOrder {

private BigDecimal stopPrice;

private BigDecimal trailingRate;

private Long orderOrigTime;

private Long lastActTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ public List<AccountHistory> 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<AccountHistory> 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) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/huobi/service/huobi/HuobiMarketService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> commandList = new ArrayList<>(1);

String topic = WEBSOCKET_MARKET_MBP_INCREMENT_TOPIC
Expand Down

0 comments on commit 18af788

Please sign in to comment.