获取订单信息

大约 11 分钟

预览订单(仅环球账户)

对应的请求类:TigerHttpRequest(MethodName.PREVIEW_ORDER)

说明

预览订单

参数

参数类型是否必填描述
accountstringYes用户授权账户:DU575569,目前仅支持环球账户
symbolstringYes股票代码 如:AAPL
sec_typestringYes合约类型 (STK 股票 OPT 美股期权 WAR 港股窝轮 IOPT 港股牛熊证)
actionstringYes交易方向 BUY/SELL
order_typestringYes订单类型. MKT(市价单), LMT(限价单), STP(止损单), STP_LMT(止损限价单), TRAIL(跟踪止损单)
total_quantityintYes订单数量(港股,沪港通,窝轮,牛熊证有最小数量限制)
limit_pricedoubleNo限价,当 order_type 为LMT,STP,STP_LMT时该参数必需
aux_pricedoubleNo股票止损价。当 order_type 为STP,STP_LMT时该参数必需,当 order_type 为 TRAIL时,为跟踪额
trailing_percentdoubleNo跟踪止损单-百分比 ,当 order_type 为 TRAIL时,aux_price和trailing_percent两者互斥
outside_rthbooleanNotrue: 允许盘前盘后交易(美股专属), false: 不允许, 默认允许
marketstringNo市场 (美股 US 港股 HK 沪港通 CN)
currencystringNo货币(美股 USD 港股 HKD 沪港通 CNH)
time_in_forcestringNo订单有效期,只能是 DAY(当日有效)和GTC(取消前有效),默认为DAY
exchangestringNo交易所 (美股 SMART 港股 SEHK 沪港通 SEHKNTL 深港通 SEHKSZSE)
expirystringNo过期日(期权、窝轮、牛熊证专属)
strikestringNo底层价格(期权、窝轮、牛熊证专属)
rightstringNo期权方向 PUT/CALL(期权、窝轮、牛熊证专属)
multiplierfloatNo1手单位(期权、窝轮、牛熊证专属)
local_symbolstringNo窝轮牛熊证该字段必填,在app窝轮/牛熊证列表中名称下面的5位数字

返回

名称类型说明
accountstring用户账户
statusstring根据订单参数判断真正下单后可能会出现的状态
initMargindouble初始保证金金额,仅保证金账户有此属性
maintMargindouble维持保证金金额,仅保证金账户有此属性
equityWithLoandouble具有借贷价值的资产值, 对于现金账户 = cashBalance, 对于保证金账户 = cashBalance + grossPositionValue
initMarginBeforedouble下单前初始保证金
maintMarginBeforedouble下单前维持保证金
equityWithLoanBeforedouble下单前借贷资产值
marginCurrencystring保证金账户主币种
commissiondouble佣金金额
minCommissiondouble当佣金无法确认时,计算出的最低佣金
maxCommissiondouble当佣金无法确认时,计算出的最多佣金
commissionCurrencydouble佣金币种,比如账户主币种是港币,下美股订单时,佣金币种是USD
warningTextstring错误信息提示

示例

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
TigerHttpRequest request = new TigerHttpRequest(MethodName.PREVIEW_ORDER);

String bizContent = TradeParamBuilder.instance()
    .account("DU575569")
    .orderId(0)
    .symbol("AAPL")
    .totalQuantity(500)
    .limitPrice(61.0)
    .orderType(OrderType.LMT)
    .action(ActionType.BUY)
    .secType(SecType.STK)
    .currency(Currency.USD)
    .outsideRth(false)
    .buildJson();

request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);
JSONObject data = JSON.parseObject(response.getData());
BigDecimal equityWithLoan = data.getBigDecimal("equityWithLoan");
System.out.println(data)

返回示例

{
	"account": "DU575569",
	"status": "Inactive",
	"initMargin": 73803.41,
	"maintMargin": 66088.28,
	"equityWithLoan": 48570.99,
	"initMarginBefore": 45604.94,
	"maintMarginBefore": 40601.39,
	"equityWithLoanBefore": 48570.99,
	"marginCurrency": "USD",
	"commissionCurrency": "",
	"warningText": "YOUR ORDER IS NOT ACCEPTED. IN ORDER TO OBTAIN THE DESIRED POSITION YOUR EQUITY 	WITH LOAN VALUE [47636.67 USD] MUST EXCEED THE INITIAL MARGIN [72635.51 USD]"
}

获取订单

对应的请求类:TigerHttpRequest(MethodName.ORDERS)

说明

获取订单

参数

获取指定单个订单

参数类型是否必填描述
accountstringYes用户授权账户:572386
idintYes下单成功后返回的订单号
secret_keystringNo机构用户专用,交易员密钥
show_chargesboolNo是否返回订单的费用明细

获取订单列表

参数类型是否必填描述
accountstringYes用户授权账户:572386
seg_typeSegmentTypeNo账户划分类型, 可选值有: SegmentType.SEC 代表证券; SegmentType.FUT 代表期货; SegmentType.FUND 代表基金, SegmentType.ALL:代表证券+期货+基金。 默认为SegmentType.SEC
sec_typestringNoALL/STK/OPT/FUT/FOP/CASH 默认 ALL
marketstringNoALL/US/HK/CN 默认 ALL
symbolstringNo股票代码
expirystringNo过期日(期权、窝轮、牛熊证专属)
strikestringNo行权价格(期权、窝轮、牛熊证专属)
rightstringNo期权方向 PUT/CALL(期权、窝轮、牛熊证专属)
start_datestringNo订单下单时间的起始时间(当 sort_by=LATEST_STATUS_UPDATED 时,按订单状态更新时间进行过滤),格式为'2018-05-01' 或者 "2018-05-01 10:00:00"(默认东八区,可指定时区),闭区间
end_datestringNo订单下单时间的截止时间(当 sort_by=LATEST_STATUS_UPDATED 时,按订单状态更新时间进行过滤),格式为'2018-05-15' 或者 "2018-05-01 10:00:00"(默认东八区,可指定时区),开区间
statesarrayNo】订单状态, 默认查有效订单,参考:订单状态
isBriefbooleanNo】是否返回精简的订单信息
limitintegerNo默认:100, 最大限制: 300
sort_byOrderSortByNo】排序和起止时间作用字段,LATEST_CREATED/LATEST_STATUS_UPDATED; 默认值:LATEST_CREATED
secret_keystringNo机构用户专用,交易员密钥
langstringNo语言支持(枚举类Language): zh_CN,zh_TW,en_US, 默认: en_US
page_tokenstringNo分页查询token,使用pageToken分页拉取数据时其他查询条件不能变

返回

com.tigerbrokers.stock.openapi.client.https.response.trade.SingleOrderResponsecom.tigerbrokers.stock.openapi.client.https.response.trade.BatchOrderResponse

字段类型说明
nextPageTokenstring查询下一页用的token
itemsarray订单数组,字段参考下面说明

其中订单数据items属性如下:

名称示例说明
id27363676799501312订单全局唯一ID,下单成功后返回
orderId830154374用户本地的自增订单ID,非全局唯一
externalId830154374扩展ID, API下单为orderId的值
parentId0父订单的订单ID
account572386交易账户
actionBUY交易方向,BUY or SELL
orderTypeLMT订单类型
limitPrice108.62限价单价格
auxPrice0.0止损单辅助价格-跟踪额
trailingPercent5跟踪止损单的跟踪百分比
totalQuantity111下单数量
totalQuantityScale0下单数量的偏移量,默认为0。碎股单的totalQuantity 和 totalQuantityScale 结合起来代表真实下单数量,如 totalQuantity=111 totalQuantityScale=2,那么真实 quantity=111*10^(-2)=1.11
timeInForceDAYDAY/GTC/GTD
expireTime1669000183188timeInForce为GTD时才有值
outsideRthtrue是否允许盘前、盘后
filledQuantity50成交数量
filledQuantityScale0成交数量偏移量,如 filledQuantity=11123, filledQuantityScale=2,那么实际 filledQuantity=11123*10^(-2)=111.23
totalCashAmount100下单总金额,按股数下单时为null
filledCashAmount100已成交金额,按股数下单时为null
refundCashAmount0退回金额,等于下单总金额-已成交金额。按股数下单或订单未终结时为null
avgFillPrice108.62包含佣金的平均成交价
remarkOrder is expired错误描述
statusFilled订单状态,参考:订单状态
attrDescExercise订单描述信息,参考:订单描述
commission0.99包含佣金、印花税、证监会费等系列费用
commissionCurrencyUSD佣金币种
gst1.34消费税 (仅TBSG牌照用户有)
realizedPnl0.0已实现盈亏
openTime1657667486000下单时间
updateTime1657670428000最后更新时间
latestTime1657670428000状态更新时间
symbolBABA股票代码
currencyUSD货币
marketUS交易市场
multiplier0.0每手股数
secTypeSTK交易类型
userMarkmy_strategy_1下单时备注参数,会按照设置值返回,长度不能超过200
canModifyfalse是否可修改订单
canCancelfalse是否可撤销订单
liquidationfalse是否强制平仓
isOpentrue是否为开仓
replaceStatusNONE订单改单状态
cancelStatusNONE订单撤单状态
charges订单佣金等费用明细(仅限单个订单查询)。详细说明见下方Charge描述。
commissionDiscountAmount0免佣金额(仅限单个订单查询)
orderDiscountAmount0订单扣减金额
orderDiscount0订单抵扣状态(仅限单个订单查询)。1:待抵扣;2:已抵扣;0:默认值

Charge说明:

名称示例说明
categoryTIGER费用类别:TIGER/THIRD_PARTY
categoryDescTiger Charge费用类别描述:Tiger Charge; Third Parties
total18当前类别费用总额
details费用明细。详细说明见下方ChargeDetails描述。

ChargeDetails说明:

名称示例说明
typeSETTLEMENT_FEE费用类型:SETTLEMENT_FEE/STAMP_DUTY/TRANSACTION_LEVY/EXCHANGE_FEE/FRC_TRANSACTION_LEVY
typeDescSettlement Fee费用类型描述:Settlement Fee(结算费); Stamp Duty(印花税); Transaction Levy(交易征费); Exchange Fee(交易所费用); AFRC Transaction Levy(会计及才会局交易征费)
originalAmount4费用金额
afterDiscountAmount4抵扣后的费用

示例

获取单个订单

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QuerySingleOrderRequest request = new QuerySingleOrderRequest();

String bizContent = AccountParamBuilder.instance()
        .account("572386")
        .id(31227598058424320L)
        .isShowCharges(true)
        .lang(Language.en_US)
        .buildJson();

request.setBizContent(bizContent);
SingleOrderResponse response = client.execute(request);

if (response.isSuccess()) {
  System.out.println(JSONObject.toJSONString(response));
  Long id = response.getItem().getId();
  String action = response.getItem().getAction();
  // ...
} else {
  System.out.println(response.getMessage());
}

获取订单列表

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest();

String bizContent = AccountParamBuilder.instance()
    .account("572386")
    .startDate("2023-04-01 00:00:00", TimeZoneId.NewYork)
    .endDate("2023-06-20 23:59:59", TimeZoneId.NewYork)
    .secType(SecType.STK)
    .sortBy(OrderSortBy.LATEST_CREATED)
    .limit(5)
    .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

if (response.isSuccess()) {
  System.out.println(JSONObject.toJSONString(response));
  List<TradeOrder> orders = response.getItem().getOrders();
  TradeOrder order1 = orders.get(0);
  String symbol = order1.getString("symbol");
  Long id = order1.getLong("id");
  // ...
} else {
  System.out.println(response.getMessage());
}

返回示例

单个订单

{
    "code": 0,
    "data": {
        "account": "572386",
        "action": "SELL",
        "algoStrategy": "LMT",
        "attrDesc": "",
        "attrList": [
            "SETTLED"
        ],
        "avgFillPrice": 3.54,
        "canCancel": false,
        "canModify": false,
        "cancelStatus": "NONE",
        "charges": [
            {
                "category": "TIGER",
                "categoryDesc": "Tiger Charge",
                "details": [
                    {
                        "afterDiscountAmount": 18,
                        "originalAmount": 18,
                        "type": "USER_COMMISSION",
                        "typeDesc": "Commission"
                    }
                ],
                "total": 18
            },
            {
                "category": "THIRD_PARTY",
                "categoryDesc": "Third Parties",
                "details": [
                    {
                        "afterDiscountAmount": 4,
                        "originalAmount": 4,
                        "type": "SETTLEMENT_FEE",
                        "typeDesc": "Settlement Fee"
                    },
                    {
                        "afterDiscountAmount": 22,
                        "originalAmount": 22,
                        "type": "STAMP_DUTY",
                        "typeDesc": "Stamp Duty"
                    },
                    {
                        "afterDiscountAmount": 0.58,
                        "originalAmount": 0.58,
                        "type": "TRANSACTION_LEVY",
                        "typeDesc": "Transaction Levy"
                    },
                    {
                        "afterDiscountAmount": 1.2,
                        "originalAmount": 1.2,
                        "type": "EXCHANGE_FEE",
                        "typeDesc": "Exchange Fee"
                    },
                    {
                        "afterDiscountAmount": 0.04,
                        "originalAmount": 0.04,
                        "type": "FRC_TRANSACTION_LEVY",
                        "typeDesc": "AFRC Transaction Levy"
                    }
                ],
                "total": 27.82
            }
        ],
        "commission": 45.82,
        "currency": "HKD",
        "discount": 0,
        "externalId": "710344498739626686",
        "filledCashAmount": 21240,
        "filledQuantity": 6000,
        "filledQuantityScale": 0,
        "gst": 0,
        "id": 36810407788938240,
        "identifier": "01177",
        "isOpen": false,
        "latestTime": 1729740324000,
        "limitPrice": 3.54,
        "liquidation": false,
        "market": "HK",
        "name": "SINO BIOPHARM",
        "openTime": 1729740323000,
        "orderDiscount": 0,
        "orderId": 0,
        "orderType": "LMT",
        "outsideRth": false,
        "realizedPnl": -6388.735,
        "remark": "",
        "replaceStatus": "NONE",
        "secType": "STK",
        "source": "android",
        "status": "Filled",
        "symbol": "01177",
        "timeInForce": "GTC",
        "totalQuantity": 6000,
        "totalQuantityScale": 0,
        "tradingSessionType": "RTH",
        "updateTime": 1730045103000,
        "userMark": ""
    },
    "message": "success",
    "sign": "F9xRzsjqgFlfaUJVajSber2jfCOVt1DIovKcE3yxWK9DFqfTPXHxKqCJ3aT8bGPl/8THViWW0A62LlRL1RB41cLt6bsMUyG7+nSQOE2vPIdo29SyZGcPAiSdRHbY8h3Nq9V1PzVQVqs07joUOw5dUuO5M3TgY/R0UHFV0lwxkBM=",
    "success": true,
    "timestamp": 1730971141181
}

订单列表

{
    "code":0,
    "data":{
        "items":[
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"MKT",
                "attrDesc":"",
                "avgFillPrice":9.36,
                "canCancel":false,
                "canModify":false,
                "commission":2.4,
                "currency":"USD",
                "discount":0,
                "externalId":"980",
                "filledQuantity":10,
                "id":31227598058424320,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146866000,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146865000,
                "orderId":980,
                "orderType":"MKT",
                "outsideRth":false,
                "realizedPnl":0,
                "remark":"",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Filled",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146866000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"979",
                "filledQuantity":0,
                "id":31227591745209344,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146817000,
                "limitPrice":2,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146817000,
                "orderId":979,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order Price exceed max price step (30) limit. For more information, please contact customer service at 400-603-7555.",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Invalid",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146817000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"978",
                "filledQuantity":0,
                "id":31227575457809408,
                "identifier":"NIO.SI",
                "isOpen":true,
                "latestTime":1687146693000,
                "limitPrice":9,
                "liquidation":false,
                "market":"SG",
                "name":"NIO Inc.",
                "openTime":1687146693000,
                "orderId":978,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order Price exceed max price step (30) limit. For more information, please contact customer service at 400-603-7555.",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Invalid",
                "symbol":"NIO.SI",
                "timeInForce":"DAY",
                "totalQuantity":10,
                "updateTime":1687146693000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"977",
                "filledQuantity":0,
                "id":31175091790938112,
                "identifier":"JD",
                "isOpen":true,
                "latestTime":1686788253000,
                "limitPrice":35,
                "liquidation":false,
                "market":"US",
                "name":"JD.com",
                "openTime":1686746274000,
                "orderId":977,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order is expired",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Inactive",
                "symbol":"JD",
                "timeInForce":"DAY",
                "totalQuantity":1,
                "updateTime":1686788253000,
                "userMark":""
            },
            {
                "account":"572386",
                "action":"BUY",
                "algoStrategy":"LMT",
                "attrDesc":"",
                "avgFillPrice":0,
                "canCancel":false,
                "canModify":false,
                "commission":0,
                "currency":"USD",
                "discount":0,
                "externalId":"976",
                "filledQuantity":0,
                "id":31175084828133376,
                "identifier":"JD",
                "isOpen":true,
                "latestTime":1686788253000,
                "limitPrice":35.9,
                "liquidation":false,
                "market":"US",
                "name":"JD.com",
                "openTime":1686746221000,
                "orderId":976,
                "orderType":"LMT",
                "outsideRth":true,
                "realizedPnl":0,
                "remark":"Order is expired",
                "secType":"STK",
                "source":"OpenApi",
                "status":"Inactive",
                "symbol":"JD",
                "timeInForce":"DAY",
                "totalQuantity":1,
                "updateTime":1686788253000,
                "userMark":""
            }
        ],
        "nextPageToken":"b3JkZXJzfDE2ODAzMjE2MDAwMDB8MTY4NzMxOTk5OTAwMHwzMTE3NTA4NDgyODEzMzM3Ng=="
    },
    "message":"success",
    "sign":"u59vLeh+5Wvim9SwxaW16k9nvTXfnSkZqPqUcq0p0CBtfXQNUFk4nxJXXA6jKXF2RcdfzZn+lkODMpxiI8dGC2bi+/4MoqpnkWGQFAlur/YCSSgTG+TUv1p2mfwZ2CLpKzzNaDk1NEcni+AX1JBeWJeo0GS6bgo8ic22hdS5BLE=",
    "success":true,
    "timestamp":1687251914180
}

获取已成交订单列表

对应的请求类:QueryOrderRequest(MethodName.FILLED_ORDERS)

说明

获取状态为成交的订单列表

参数

参考获取订单,其中start_date和end_date为必传参数。

示例

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.FILLED_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("402901")
        .secType(SecType.STK)
        .startDate("2023-05-15 22:34:30")
        .endDate("2023-06-06 22:34:31")
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

返回

参考获取订单

获取待成交订单列表

对应的请求类:QueryOrderRequest(MethodName.ACTIVE_ORDERS)

参数

参考获取订单,可能包含部分成交的订单

示例

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.ACTIVE_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("DU575569")
        .secType(SecType.STK)
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

返回

参考获取订单

获取已撤销订单列表

对应的请求类:QueryOrderRequest(MethodName.INACTIVE_ORDERS)

参数

参考获取订单

示例

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
QueryOrderRequest request = new QueryOrderRequest(MethodName.INACTIVE_ORDERS);

String bizContent = AccountParamBuilder.instance()
        .account("DU575569")
        .secType(SecType.STK)
        .buildJson();

request.setBizContent(bizContent);
BatchOrderResponse response = client.execute(request);

返回

参考获取订单

获取成交记录

对应的请求类:TigerHttpRequest(MethodName.ORDER_TRANSACTIONS)

说明

获取订单的成交记录

参数

参数类型是否必填描述
accountStringYes账户,目前仅支持综合账户
order_idlongYes下单成功后返回的全局订单ID,非本地订单ID。 order_id 和 symbol其中一个必传。 使用orderId后,symbol参数不生效
symbolStringYes股票代码。order_id 和 symbol其中一个必传。
sec_typeStringNo, 指定symbol查询时必传STK:股票/FUT:期货/OPT:期权/WAR:窝轮/IOPT:牛熊证, 未指定查全部。
expiryStringNo, sect_type为OPT/WAR/IOPT类型时必传到期日
rightStringNo, sect_type为OPT/WAR/IOPT类型时必传CALL/PUT
start_datelongNo起始时间(yyyy-MM-dd HH-mm-ss格式需要转换为毫秒的时间戳)
end_datelongNo截止时间(yyyy-MM-dd HH-mm-ss格式需要转换为毫秒的时间戳)
limitintNo返回数据数量限制,默认20, 最大100
secretKeyStringNo机构用户专用,交易员密钥

返回

字段示例说明
id24653027221308416成交记录ID
accountId402190账号
orderId24637316162520064订单ID
secTypeSTK证券类型
symbolCIIsymbol
currencyUSD币种
marketUS市场
actionBUY动作, BUY/SELL
filledQuantity100成交数量
filledPrice21成交价
filledAmount2167.0成交金额
transactedAt2021-11-15 22:34:30成交时间
transactionTime1636986870000成交时间戳

示例

// 按照symbol查询
TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
String bizContent = AccountParamBuilder.instance()
    .account("402501")
    .secType(SecType.STK)
    .symbol("CII")
    .limit(30)
    .startDate("2021-11-15 22:34:30")
    .endDate("2021-11-15 22:34:31")
    .buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);

JSONArray data = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject trans1 = data.getJSONObject(0);
 

// 按照orderId查询
TigerHttpRequest request = new TigerHttpRequest(MethodName.ORDER_TRANSACTIONS);
    String bizContent = AccountParamBuilder.instance()
        .account("402501")
        .orderId(24637316162520064L)
        .limit(30)
        .buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);

JSONArray data = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject trans1 = data.getJSONObject(0);

返回示例

{
	"items": [
		{
			"id": 24653027221308416,
			"accountId": 402901,
			"orderId": 24637316162520064,
			"secType": "STK",
			"symbol": "CII",
			"currency": "USD",
			"market": "US",
			"action": "BUY",
			"filledQuantity": 100,
			"filledPrice": 21.67,
			"filledAmount": 2167,
			"transactedAt": "2021-11-15 22:34:30",
      "transactionTime": 1636986870000
		}
	]
}
上次编辑于: