Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get followers' open orders #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,10 @@ Call<ResponseResult> followerHistoryOrders(@Query("pageSize") String pageSize,
@Query("pageNo") String pageNo,
@Query("startTime") String startTime,
@Query("endTime") String endTime);

@GET("/api/mix/v1/trace/followerOrder")
Call<ResponseResult> followerOpenOrders(@Query("symbol") String symbol,
@Query("productType") String productType,
@Query("pageSize") int pageSize,
@Query("pageNo") int pageNo);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.bitget.openapi.dto.response;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class FollowerOpenOrderResult {

private static final long serialVersionUID = 2182672129628573247L;

private String trackingNo;

private String openOrderId;

private String closeOrderId;

private String symbol;

private String holdSide;

private Integer openLeverage;

private Double openAvgPrice;

private Long openTime;

private String openDealCount;

private String openMargin;

private Double averageClosePrice;

private String closeDealCount;

private Long closeTime;
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,6 @@ public interface MixTraceService {
ResponseResult waitProfitDateList(int pageSize,int pageNo) throws IOException;

ResponseResult followerHistoryOrders(String pageSize,String pageNo,String startTime,String endTime) throws IOException;

ResponseResult followerOpenOrders(String symbol,String productType,int pageSize,int pageNo) throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ public ResponseResult waitProfitDateList(int pageSize, int pageNo) throws IOExce
public ResponseResult followerHistoryOrders(String pageSize, String pageNo, String startTime, String endTime) throws IOException {
return mixTraceApi.followerHistoryOrders(pageSize,pageNo,startTime,endTime).execute().body();
}

@Override
public ResponseResult followerOpenOrders(String symbol,String productType,int pageSize,int pageNo) throws IOException {
return mixTraceApi.followerOpenOrders(symbol, productType, pageSize, pageNo).execute().body();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,11 @@ public void followerHistoryOrders() throws IOException {
ResponseResult result = bitgetRestClient.mix().bitget().trace().followerHistoryOrders("10","1","1635782400000","1635852263953");
System.out.println(JSON.toJSONString(result));
}

//passed
@Test
public void followerOpenOrders() throws IOException {
ResponseResult result = bitgetRestClient.mix().bitget().trace().followerOpenOrders(symbol,MixProductTypeEnum.UMCBL.getCode(),10,1);
System.out.println(JSON.toJSONString(result));
}
}