Get Order Information

About 9 min

Preview Orders (Global Account Only) TigerHttpRequest(MethodName.PREVIEW_ORDER)

Description

Get order preview

Argument

ArgumentTypeRequiredDescription
accountstringYesAccount id, example :DU575569. Global Accounbt Only
symbolstringYesTicker symbol of the asset, example: AAPL
sec_typestringYesSecurity Type (STK-stocks, OPT-US Options, WAR-Warrants, IOPT-CBBC)
actionstringYesOrder direction: BUY/SELL
order_typestringYesOrder Types,'MKT'-Market Order / 'LMT'-Limit Order / 'STP'-Stop Order / 'STP_LMT'-Stop-Limit Order / 'TRAIL'-Trailing Stop Order
total_quantityintYesOrder's quantity (There is a minimum quantity requirement for HK market)
limit_pricedoubleNoLimit price, required if placing a limit order (inluding STP and STP_LMT)
aux_pricedoubleNoAuxiliary price. it represents the stop price if placing a stop price, trailing price if placing a trailing stop order
trailing_percentdoubleNoTrailing activation price for trailing stop orders (by percentage). When the order type is TRAIL, it cannot be assgined a value when aux_price already has a value
outside_rthbooleanNoif trade outside regular trading hours (only applicable to U.S. market)
marketstringNoMarket (US, HK, CN, etc.)
currencystringNoCurrency (USD, HKD, CNH, etc.)
time_in_forcestringNoTime in force,'DAY'-valid until market close,'GTC'-Good-Till-Cancel,'DAY' by default
exchangestringNoExchange code (U.S stocks SMART, Shanghai-Hong Kong Stock Connect-SEHK, A-Shares-SEHKNTL,Shenzhen-Hong Kong Stock Connect SEHKSZSE)
expirystringNoExpiration data for options, warrants and CBBC
strikestringNoStrike price for options, warrants and CBBC
rightstringNoPUT/CALL for options, warrants and CBBC
multiplierfloatNomultiplier for options, warrants and CBBC
local_symbolstringNoRequired when trading CBBC, This is the 5-digit number under the Warrant/CBBC list in the TigerTrade APP

Response

NameTypeDescription
accountstringAccount id
statusstringPossible status
initMargindoubleInitial Margin, margin account only
maintMargindoubleMaintance Margin, margin account only
equityWithLoandoubleEquity With Loan, for cash account, equityWithLoan = cashBalance, for margin account, equityWithLoan= cashBalance + grossPositionValue
initMarginBeforedoubleInitial Margin before placing this order
maintMarginBeforedoubleMaintance Margin before placing this order
equityWithLoanBeforedoubleEquity With Loan before placing this order
marginCurrencystringMargin Currency
commissiondoubleTotal commission
minCommissiondoubleMinimum commission, if the commission cannot be calculated accurately
maxCommissiondoubleMaximum commission, if the commission cannot be calculated accurately
commissionCurrencydoubleCommission Currency. When the primary Currency is HKD, when placing orders in the US market, the commission currency will be USD
warningTextstringWarning test, if any

Example

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)

Response Example

{
	"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]"
}

Get Orders

RequestQuerySingleOrderRequest(MethodName.ORDERS)QueryOrderRequest(MethodName.ORDERS)

Description

Get details for orders that you placed

Argument

Get a single order

ArgumentTypeRequiredDescription
accountstringYesAccount id: 572386
idintYesorder id, this id is used to identify an order on the server
secret_keystringNoSecret key for the trader of institutions, please config in client_config, ignore if you are a individual user
show_chargesboolNoreturn commission and fee details

Get a list of orders

ArgumentTypeRequiredDescription
accountstringYesAccount id:572386
seg_typeSegmentTypeNoAccount segment. Available: SegmentType.SEC for Securities; SegmentType.FUT for Commodities; SegmentType.FUND for funds, SegmentType.ALL for Securities + Commodities + Funds. defaul value is SegmentType.SEC
sec_typestringNoALL/STK/OPT/FUT/FOP/CASH/FUND, ALL by default
marketstringNoALL/US/HK/CN, defaul value is ALL
symbolstringNoStock ticker symbol
expirystringNoExpiration data for options, warrants and CBBC
strikestringNoStrike price for options, warrants and CBBC
rightstringNoPUT/CALL for options, warrants and CBBC
start_datestringNoThe starting time of the order placing time (when sort_by=LATEST_STATUS_UPDATED, the starting time of the order status updated time), the format is '2018-05-01'/ "2018-05-01 10:00:00"(Default 'GMT +8', can set the value of TimeZoneId to 'NewYork'), close interval
end_datestringNoThe ending time of the order placing time (when sort_by=LATEST_STATUS_UPDATED, the ending time of the order status updated time), the format is '2018-05-15' /"2018-05-01 10:00:00"(Default 'GMT +8', can set the value of TimeZoneId to 'NewYork'), open interval
statesarrayNoOrder status, open orders by default, Please refer to: Order Status for possible states
isBriefbooleanNo0 for detailed information, 1 for concise information
limitintegerNoMaximum number of orders returned. Default value is 100. Maximum possible value is 300
sort_byOrderSortByNoFields used to sort and filter start_date and end_date,LATEST_CREATED/LATEST_STATUS_UPDATED; Default:LATEST_CREATED
secret_keystringNoSecret key for the trader of institutions, please config in client_config, ignore if you are a indiviual user
langstringNoLanguage: zh_CN,zh_TW,en_US, By default: en_US
page_tokenstringNoToken for paging query

Response

com.tigerbrokers.stock.openapi.client.https.response.trade.SingleOrderResponse or com.tigerbrokers.stock.openapi.client.https.response.trade.BatchOrderResponse

NameTypeDescription
nextPageTokenstringpage token for next query
itemsarrayAn array of orders, please refer to the description below for detailed fields

items have the following attributes:

NameExampleDescription
id135482687464472583unique order id assigned by the server
orderId1000003917order id assigned by the user, not unique
externalId1000003917external id, The value is the same as 'orderId' when placing an order through the API
parentId0order id of the main (parent) order
account572386Account id
actionBUYOrder direction: BUY/SELL
orderTypeLMTOrder Types,'MKT'-Market Order / 'LMT'-Limit Order / 'STP'-Stop Order / 'STP_LMT'-Stop-Limit Order / 'TRAIL'-Trailing Stop Order
limitPrice108.62Limit price
auxPrice0.0Auxiliary price. it represents the stop price if placing a stop price, trailing price if placing a trailing stop order
trailingPercent5Trailing activation price for trailing stop orders (by percentage)
totalQuantity50Order's quantity
totalQuantityScale0The offset of the order quantity, default is 0. The combination of 'totalQuantity' and 'totalQuantityScale' of odd lot orders represents the actual order quantity. For example, totalQuantity=111 totalQuantityScale=2, then the real quantity=111*10^(-2)=1.11
timeInForceDAYDAY/GTC/GTD
expireTime1669000183188supported by GTD order
outsideRthTrueif trade outside regular trading hours (only applicable to U.S. market)
filledQuantity50filled quantity
filledQuantityScale0filled quantity scale,For example, the filledQuantity value is 2135, the filledQuantityScale is 2, and the actual number of filledQuantity is 21.35
totalCashAmount100Total order cash amount, null when ordering by shares
filledCashAmount100Filled order amount, null when ordering by shares
refundCashAmount0Refunded amount, equal to 'totalCashAmount' minus 'filledCashAmount'. Null when ordering by shares or when the order is not terminated.
avgFillPrice108.62average fill price
liquidationfalseif the order has been cleared
remarkOrder is expirederror message
statusFilledorder status, refer to:Order status
attrDescExerciseOptions status, refer to:Options status
commission0.99Total commission
commissionCurrencyUSDCurrency of the commission
gst1.34Goods and Services Tax (TBSG only)
realizedPnl0.0Realized PNL
percentOffset0.0Percent offset
openTime1657667486000Time when order is placed
updateTime1657670428000Last time when the order is updated
latestTime1657670428000Last status update time
symbolBABAStock ticker symbol
currencyUSDCurrency
marketUSMarket
multiplier0.0lot size
secTypeSTKSecurity Type (STK-stocks, OPT-US Options, WAR-Warrants, IOPT-CBBC)
userMarkmy_strategy_1order's remark info,max length is 200
canModifyfalseWhether the order can be modified
canCancelfalseWhether the order can be cancelled
liquidationfalseis it a forced liquidation order
isOpentrueIs it an opening order
replaceStatusNONEOrder replace status
cancelStatusNONEOrder cancel status
chargescommission and fee details(Only valid when querying order by ID and 'show_charges' = true). refer to Charge details.
commissionDiscountAmount0commission discount amount(Only valid when querying order by ID)
orderDiscountAmount0order discount amount(Only valid when querying order by ID)
orderDiscount0order discount status. 1:unfinished;2:finished;0:default

ChargeDescription:

NameExampleDescription
categoryTIGERfee category:TIGER/THIRD_PARTY
categoryDescTiger Chargefee category desc:Tiger Charge; Third Parties
total18tatal amount
detailsfee details. refer to ChargeDetails details.

ChargeDetailsDescription:

NameExampleDescription
typeSETTLEMENT_FEEfee type:SETTLEMENT_FEE/STAMP_DUTY/TRANSACTION_LEVY/EXCHANGE_FEE/FRC_TRANSACTION_LEVY
typeDescSettlement Feefee type desc:Settlement Fee; Stamp Duty; Transaction Levy; Exchange Fee; AFRC Transaction Levy
originalAmount4original amount
afterDiscountAmount4amount after deduction

Example

Get an Order

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());
}

Get Order List

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());
}

Response Example

Single Order

{
    "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
}

List of orders

{
    "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
}

Get Filled Orders

RequestQueryOrderRequest(MethodName.FILLED_ORDERS)

Description

Get a list of orders that has been filled

Argument

Refer to get orders, start_date and end_date are required argument.

Example

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("2021-11-15 22:34:30")
        .endDate("2022-01-06 22:34:31")
        .buildJson();

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

Response

See get orders

Get Open Orders

RequestQueryOrderRequest(MethodName.ACTIVE_ORDERS)

Argument

See get orders

Example

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);

Response

See get orders

Get inactive orders

RequestQueryOrderRequest(MethodName.INACTIVE_ORDERS)

Argument

See get orders

Response

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);

Response

See get orders

Get Transaction History TigerHttpRequest(MethodName.ORDER_TRANSACTIONS)

Description

Get the transaction record of the order

Argument

ArgumentTypeRequiredDescription
accountStringYesAccount id, prime account only
order_idlongYesOrder ID. order_id and symbol, at least one needs to have a value. if orderId is assigned, you are not able to search orders by order id
symbolStringYesticker symbol. order_id and symbol, at least one needs to have a value
sec_typeStringNo, required if search by symbolSTK:stocks/FUT:futures/OPT:options/WAR:warrants/IOPT:CBBC, ALL if not specify
expiryStringNo, required when sec_type is OPT/WAR/IOPTExpiration Date
rightStringNo, required when sec_type is OPT/WAR/IOPTCALL/PUT
start_datelongNostart date
end_datelongNoend date
limitintNoMaximum number of orders returned, 20 by default, maximum is 100
secretKeyStringNoSecret key for the trader of institutions, please config in client_config, ignore if you are a indiviual user

Response

NameExampleDescription
id24653027221308416transaction ID
accountId402190account ID
orderId24637316162520064order ID
secTypeSTKsecurity type
symbolCIIsymbol
currencyUSDcurrency
marketUSmarket
actionBUYorder direction, BUY/SELL
filledQuantity100filled quantity
filledPrice21filled price
filledAmount2167.0filled amount
transactedAt2021-11-15 22:34:30transaction time
transactionTime1636986870000transaction timestamp

Example

// search by symbols
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);
 
 
// Search by 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);

Response Example

{
	"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
		}
	]
}
Last update: