Query Account Information
Account List
Corresponding request class: TigerHttpRequest(MethodName.ACCOUNTS)
Description
Retrieve the list of managed accounts. Institutional accounts will return the master account and all sub-accounts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | No | The user's authorized account (paper trading accounts are not supported), if not provided, all accounts will be returned, including: Prime, Global, Paper trading. |
Return
The specific data is saved in the returned data field, with the following meanings:
| Field | Example | Description |
|---|---|---|
| account | Prime: 50129912, Global: U5755619, Paper trading: 20191221901212121 | Trading capital account. Prime account is 5 to 10 digits, Paper trading account is 17 digits, Global account starts with the letter U |
| capability | RegTMargin | Account type (CASH: cash account, RegTMargin: Reg T margin account, PMGRN: portfolio margin) |
| status | Funded | Account status, "Funded" for most cases. Status includes: Funded, Open, Pending, Rejected, Closed |
| accountType | STANDARD | Account classification (GLOBAL: global account, STANDARD: prime account, PAPER: paper trading account) |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
TigerHttpRequest request = new TigerHttpRequest(MethodName.ACCOUNTS);
String bizContent = AccountParamBuilder.instance()
.account("123456")
.buildJsonWithoutDefaultAccount();
# Query the default account configured in ClientConfig.DEFAULT_CONFIG
# String bizContent = AccountParamBuilder.instance().buildJson();
# Query all account lists
# String bizContent = AccountParamBuilder.instance().buildJsonWithoutDefaultAccount();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);
# Get specific field data
JSONArray accounts = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject account1 = accounts.getJSONObject(0);
String capability = account1.getString("capability");
String accountType = account1.getString("accountType");
String account = account1.getString("account");
String status = account1.getString("status");Return Example
{
"code": 0,
"message": "success",
"data": {
"items": [
{
"account": "123456",
"capability": "RegTMargin",
"status": "Funded",
"accountType": "STANDARD"
}
]
}
}Account Positions
Corresponding request class: PositionsRequest
Description
Query account positions
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account: 13810712 |
| sec_type | string | No | Security type, including: STK/OPT/FUT/WAR/IOPT/CASH/FOP/FUND, default STK |
| currency | string | No | Currency type, including: ALL/USD/HKD/CNH, default ALL |
| market | string | No | Market classification, including: ALL/US/HK/CN, default ALL |
| symbol | string | No | Stock symbol such as: 600884 / SNAP. For futures: CL1901, for options: symbol can be underlying stock code or identifier, e.g.: 'AAPL 190111C00095000', format is fixed as 21 chars, 6 chars for symbol, fill with spaces if less. Warrants/Bull-Bear send 5 digit code, options send |
| secret_key | string | No | Trader key, for institutional users only |
| expiry | string | No | Expiration date (for options, warrants, bull-bear). Format 'yyyyMMdd', e.g. '20230818' |
| strike | double | No | Strike price (for options, warrants, bull-bear), e.g. 100.5 |
| right | string | No | Call or put (for options, warrants, bull-bear). 'PUT' or 'CALL' |
| asset_quote_type | string | No | Asset quote mode (only for prime account), see Asset Quote Type Enum |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.PositionsResponse
Positions list can be obtained with List<PositionDetail> items = response.getItem().getPositions(). See example code for details
PositionDetail Description:
| Name | Type | Description |
|---|---|---|
| account | string | Trading account |
| positionQty | double | Position quantity |
| salableQty | double | Sellable quantity |
| position | long | Position quantity (deprecated) |
| positionScale | int | Position scale (deprecated), e.g. position=11123, positionScale=2, actual position=11123*10^(-2)=111.23 |
| averageCost | double | Average FIFO cost |
| averageCostByAverage | double | Average price cost |
| averageCostOfCarry | double | Diluted position cost (A-shares mode calculation) |
| latestPrice | double | Market price (during trading session), for US stocks non-trading, prime account is after-market close, global account is intra-day close |
| isLevel0Price | boolean | Whether is lv0 (delayed) market data |
| marketValue | double | Market value |
| realizedPnl | double | Realized P&L in pattern mode |
| realizedPnlByAverage | double | Realized P&L in average mode |
| unrealizedPnl | double | Unrealized P&L |
| unrealizedPnlByAverage | double | Unrealized P&L by average cost |
| unrealizedPnlPercent | double | Unrealized yield rate (Return on Investment) |
| unrealizedPnlPercentByAverage | double | Unrealized yield rate by average cost |
| unrealizedPnlByCostOfCarry | double | Unrealized P&L (A-share mode calculation) |
| unrealizedPnlPercentByCostOfCarry | double | Unrealized yield rate (A-share mode calculation) |
| multiplier | double | Quantity per lot |
| market | string | Market |
| currency | string | Trading currency |
| secType | string | Trading type |
| identifier | string | Security identifier |
| symbol | string | Stock symbol |
| strike | double | Option underlying price (options only) |
| expiry | string | Option expiry (options only) |
| right | string | Option direction (options only) |
| updateTimestamp | long | Update timestamp |
| mmPercent | double | Margin ratio |
| mmValue | double | Maintenance margin |
| todayPnl | double | Today's P&L |
| todayPnlPercent | double | Today's P&L rate |
| yesterdayPnl | double | Yesterday's fund P&L |
| lastClosePrice | double | Last intra-day close price (pre-adjusted), US stocks last trading day close during market |
| categories | List<string> | Contract types |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
PositionsRequest request = new PositionsRequest();
String bizContent = AccountParamBuilder.instance()
.account("13810712")
.secType(SecType.STK)
.buildJson();
request.setBizContent(bizContent);
PositionsResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
for (PositionDetail detail : response.getItem().getPositions()) {
String account = detail.getAccount();
String symbol = detail.getSymbol();
long position = detail.getPosition();
// ...
}
} else {
System.out.println(response.getMessage());
}Return Example
{
"code": 0,
"data": {
"items": [
{
"account": "13810712",
"averageCost": 295.8904,
"averageCostByAverage": 295.8904,
"averageCostOfCarry": 591.7807,
"categories": [
],
"currency": "USD",
"identifier": "AAPL",
"lastClosePrice": 232.98,
"latestPrice": 232.44,
"level0Price": false,
"market": "US",
"marketValue": -232.44,
"mmPercent": 0,
"mmValue": 92.976,
"multiplier": 1,
"position": -1,
"positionQty": -1,
"positionScale": 0,
"realizedPnl": 0,
"realizedPnlByAverage": 0,
"salableQty": -1,
"secType": "STK",
"symbol": "AAPL",
"todayPnl": 0.54,
"todayPnlPercent": 0.0023178,
"unrealizedPnl": 63.4504,
"unrealizedPnlByAverage": 63.4504,
"unrealizedPnlByCostOfCarry": 359.3407,
"unrealizedPnlPercent": 0.2144,
"unrealizedPnlPercentByAverage": 0.2144,
"unrealizedPnlPercentByCostOfCarry": 0.6072,
"updateTimestamp": 1720685551097
}
]
},
"message": "success",
"sign": "Wjndi3ZrsxQYWWdkrNKSPMASGfkG5trdHbVujTKrcGoVE5cN0QZBInJggnVL2rMgKd5TS00mnGcOov96iR5K5gZKRA0iQmZHUjJHTmK9JY/rEP9A18xDaljFNHMqmJ8vydFjMQXLebXTVzafbkZoI9LS1LIdoiSCD+6VocogpB0=",
"success": true,
"timestamp": 1720685551132
}Global Account Assets
Corresponding request class: TigerHttpRequest(MethodName.ASSETS)
Description
Retrieve global account assets. This is mainly applicable to global accounts. Although prime/paper trading accounts can also use this interface, there are many fields left empty, so it is recommended to use PrimeAssetRequest to query prime/paper trading account assets
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account: DU575569 |
| segment | boolean | No | Whether to include securities/futures classification, default False |
| market_value | boolean | No | Whether to include market capitalization by market, default False, only supported by global accounts |
| secret_key | string | No | Trader key, for institutional users only |
Return
com.tigerbrokers.stock.openapi.client.https.response.TigerHttpResponse Specific data is in json format, parsing steps refer to the example code below.
| Name | Example | Description |
|---|---|---|
| account | DU575569 | Trading account |
| capability | RegTMargin | Account type, margin: RegTMargin, cash: Cash |
| netLiquidation | 1233662.93 | Net liquidation value |
| equityWithLoan | 1233078.69 | Equity with loan (including assets with loan value). Securities Segment: cash value + stock value, Futures Segment: cash value - maintenance margin |
| initMarginReq | 292046.91 | Initial margin requirement |
| maintMarginReq | 273170.84 | Maintenance margin requirement |
| availableFunds | 941031.78 | Available funds (usable for trading), calculated as equity_with_loan - initial_margin_requirement |
| dayTradesRemaining | -1 | Remaining intraday trading times, -1 means no limit |
| excessLiquidity | 960492.09 | Remaining liquidity, used to represent the intraday risk value. Securities Segment calculation method: equity_with_loan - maintenance_margin_requirement. Futures Segment calculation method: net_liquidation - maintenance_margin_requirement |
| buyingPower | 6273545.18 | Buying power. Estimated how much more stock assets you can buy in USD. Margin accounts can have up to four times the amount of funds (funds not occupied as margin) in a day. Overnight, up to two times the buying power |
| cashValue | 469140.39 | Cash in securities account + cash in futures account |
| accruedCash | -763.2 | Accrued interest for the current month, updated daily |
| accruedDividend | 0.0 | Accumulated dividends. Refers to the accumulated value of all dividends executed but still unpaid |
| grossPositionValue | 865644.18 | Total value of securities: value of long stocks + value of short stocks + value of long options + value of short options. |
| SMA | 0.0 | Special memorandum account, overnight risk value (App) |
| regTEquity | 0.0 | Only for securities Segment, i.e., equity with loan calculated according to Regulation T Act |
| regTMargin | 0.0 | Only for securities Segment, i.e., initial margin requirements calculated according to Regulation T Act |
| cushion | 0.778569 | Remaining liquidity as a proportion of total assets, calculated as: excess_liquidity/net_liquidation |
| currency | USD | Currency |
| realizedPnl | -248.72 | Actual P&L |
| unrealizedPnl | -17039.09 | Unrealized P&L |
| updateTime | 0 | Update time |
| segments | Account information by transaction type. Content is a Map, with two keys, 'S' for securities, 'C' for futures; value is an Account object | |
| marketValues | Market capitalization information. Content is a Map, 'USD' for US market, 'HKD' for Hong Kong market; value is a MarketValue object |
segments Description:
| Name | Example | Description |
|---|---|---|
| account | DU575569 | Trading account |
| category | S | Industry classification of underlying securities C(US Commodities futures) or S(US Securities securities) |
| title | US Securities | Title |
| netLiquidation | 1233662.93 | Net liquidation value |
| cashValue | 469140.39 | Cash in securities account + cash in futures account |
| availableFunds | 941031.78 | Available funds (usable for trading) |
| equityWithLoan | 1233078.69 | Equity with loan |
| excessLiquidity | 960492.09 | Remaining liquidity, to maintain the current position, must maintain a buffer margin. Intraday risk value (App) |
| accruedCash | -763.2 | Net accrued interest |
| accruedDividend | 0.0 | Net accrued dividends |
| initMarginReq | 292046.91 | Initial margin requirement |
| maintMarginReq | 273170.84 | Maintenance margin requirement |
| regTEquity | 0.0 | RegT assets |
| regTMargin | 0.0 | RegT margin |
| SMA | 0.0 | Special memorandum account, overnight risk value (App) |
| grossPositionValue | 865644.18 | Position value |
| leverage | 1 | Leverage |
| updateTime | 1526368181000 | Update time |
marketValues Description:
| Name | Example | Description |
|---|---|---|
| account | DU575569 | Trading account |
| currency | USD | Currency |
| netLiquidation | 1233662.93 | Total assets (net liquidation value) |
| cashBalance | 469140.39 | Cash |
| exchangeRate | 0.1273896 | Exchange rate for the account's base currency |
| netDividend | 0.0 | Net dividend between payable and receivable |
| futuresPnl | 0.0 | P&L from holding futures |
| realizedPnl | -248.72 | Realized P&L |
| unrealizedPnl | -17039.09 | Unrealized P&L |
| updateTime | 1526368181000 | Update time |
| stockMarketValue | 943588.78 | Stock market value |
| optionMarketValue | 0.0 | Option market value |
| futureOptionValue | 0.0 | Future option market value |
| warrantValue | 10958.0 | Warrant market value |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
TigerHttpRequest request = new TigerHttpRequest(MethodName.ASSETS);
String bizContent = AccountParamBuilder.instance()
.account("DU575569")
.buildJson();
request.setBizContent(bizContent);
TigerHttpResponse response = client.execute(request);
JSONArray assets = JSON.parseObject(response.getData()).getJSONArray("items");
JSONObject asset1 = assets.getJSONObject(0);
String account = asset1.getString("account");
Double cashBalance = asset1.getDouble("cashBalance");
JSONArray segments = asset1.getJSONArray("segments");
JSONObject segment = segments.getJSONObject(0);
String category = segment.getString("category"); // "S" stock, "C" futureReturn Example
{
"code": 0,
"message": "success",
"data": {
"items": [{
"account": "DU575569",
"accruedCash": -763.2,
"accruedDividend": 0.0,
"availableFunds": 941031.78,
"buyingPower": 6273545.18,
"capability": "Reg T Margin",
"cashBalance": 469140.39,
"cashValue": 469140.39,
"currency": "USD",
"cushion": 0.778569,
"dayTradesRemaining": -1,
"equityWithLoan": 1233078.69,
"excessLiquidity": 960492.09,
"grossPositionValue": 865644.18,
"initMarginReq": 292046.91,
"maintMarginReq": 273170.84,
"netLiquidation": 1233662.93,
"netLiquidationUncertainty": 583.55,
"previousEquityWithLoanValue": 1216291.68,
"previousNetLiquidation": 1233648.34,
"realizedPnl": -31.68,
"unrealizedPnl": 1814.01,
"regTEquity": 0.0,
"regTMargin": 0.0,
"SMA": 0.0,
"segments": [{
"account": "DU575569",
"accruedDividend": 0.0,
"availableFunds": 65.55,
"cashValue": 65.55,
"category": "S",
"equityWithLoan": 958.59,
"excessLiquidity": 65.55,
"grossPositionValue": 893.04,
"initMarginReq": 893.04,
"leverage": 0.93,
"maintMarginReq": 893.04,
"netLiquidation": 958.59,
"previousDayEquityWithLoan": 969.15,
"regTEquity": 958.59,
"regTMargin": 446.52,
"sMA": 2172.47,
"title": "US Securities",
"tradingType": "STKMRGN",
"updateTime": 1541124813
}],
"marketValues": [{
"account": "DU575569",
"accruedCash": 0.0,
"cashBalance": -943206.03,
"currency": "HKD",
"exchangeRate": 0.1273896,
"futureOptionValue": 0.0,
"futuresPnl": 0.0,
"netDividend": 0.0,
"netLiquidation": 11223.29,
"optionMarketValue": 0.0,
"realizedPnl": -248.72,
"stockMarketValue": 943588.78,
"unrealizedPnl": -17039.09,
"updateTime": 1526368181000,
"warrantValue": 10958.0
},{
"account": "DU575569",
"accruedCash": 0.0,
"cashBalance": -1635.23,
"currency": "GBP",
"exchangeRate": 1.35566495,
"futureOptionValue": 0.0,
"futuresPnl": 0.0,
"netDividend": 0.0,
"netLiquidation": 170.39,
"optionMarketValue": 0.0,
"realizedPnl": 0.0,
"stockMarketValue": 1805.62,
"unrealizedPnl": 177.58,
"updateTime": 1526368181000,
"warrantValue": 0.0
},{
"account": "DU575569",
"accruedCash": 0.0,
"cashBalance": 703542.12,
"currency": "USD",
"exchangeRate": 1.0,
"futureOptionValue": 0.0,
"futuresPnl": 0.0,
"netDividend": 0.0,
"netLiquidation": 1208880.15,
"optionMarketValue": -64.18,
"realizedPnl": 0.0,
"stockMarketValue": 505780.03,
"unrealizedPnl": 19886.87,
"updateTime": 1526359227000,
"warrantValue": 0.0
}, {
"account": "DU575569",
"accruedCash": 0.0,
"cashBalance": -714823.64,
"currency": "CNH",
"exchangeRate": 0.1576904,
"futureOptionValue": 0.0,
"futuresPnl": 0.0,
"netDividend": 0.0,
"netLiquidation": 142250.72,
"optionMarketValue": 0.0,
"realizedPnl": 0.0,
"stockMarketValue": 859152.75,
"unrealizedPnl": -102371.43,
"updateTime": 1526368181000,
"warrantValue": 0.0
}]
},
"timestamp": 1527830042620
}Prime/Paper Trading Account Asset Query
Corresponding request class: PrimeAssetRequest
Description
Query prime/paper trading account assets
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account: 123123 |
| base_currency | string | No | Currency, HKD/USD |
| secret_key | string | No | Trader key, for institutional users only |
| consolidated | boolean | No | Whether to display aggregated Segment asset indicators. Only SEC and FUND categories of assets will be aggregated. Default is true |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.PrimeAssetResponse
PrimeAssetItem.Segment segment can be obtained with PrimeAssetItem.Segment segment = primeAssetResponse.getSegment(Category.S) to get assets by transaction type;
For each type of asset, PrimeAssetItem.CurrencyAssets assetByCurrency = segment.getAssetByCurrency(Currency.USD)` can be used to get assets in corresponding currency. See example code for details
PrimeAssetItem.Segment Description:
| Name | Type | Example | Description |
|---|---|---|---|
| account | String | 123123 | Trading account |
| currency | String | USD | Currency of the currency |
| category | String | S | Transaction type classification C(Commodities 期货) or S(Securities 证券)、F(Funds 基金) |
| capability | String | RegTMargin | Account type, margin account: RegTMargin, cash account: Cash. Margin accounts support margin trading, T+0 trading times are not limited, maximum purchasing power is 4 times the daily highest, up to 2 times the next day |
| buyingPower | Double | 6273545.18 | Maximum purchasing power. Maximum purchasing power is the maximum available purchase amount for the account. The value of maximum purchasing power can be used to estimate how much money the account can buy, but since the maximum leverage multiple for each stock is different, the actual purchasing power for purchasing a single stock should be calculated based on the specific margin ratio of the stock. Algorithm, maximum purchasing power = 4*available funds. Example: Little Tiger's available funds are 100,000 USD, then Little Tiger's maximum purchasing power is 400,000 USD. Assuming the current price of Apple stock is 250 USD per share, and the initial margin ratio of Apple is 30%, Little Tiger can buy 100,000/30%=333,333.33 USD of Apple. Assuming the initial margin ratio of Apple is 25%, Little Tiger can buy 100,000/25%=400,000 USD of Apple. Margin accounts can have up to four times the amount of funds (funds not occupied as margin) in a day. Overnight, up to two times the buying power |
| cashAvailableForTrade | Double | 1233662.1 | Available funds. Available funds are used to check whether it is possible to open a position or subscribe to new shares. Opening a position refers to buying stocks, short selling securities, etc. Note that available funds are not equal to available cash, but are calculated from total assets, option position market value, frozen funds, and initial margin, etc. When available funds are greater than 0, it means that the account can open a position, and available funds_4 is the maximum available purchase power for the account. Algorithm, available funds = total assets - US stock option market value - initial margin of the current total position - frozen funds. The algorithm for initial margin is ∑(current stock market value_initial margin ratio of the stock when opening a position). Example: Little Tiger's current total assets are 10,000 USD, holding 1,000 USD of US stock options, holding a total market value of 2,000 USD of apples, and the current initial margin ratio of apples is 45%, no frozen funds, Little Tiger's available funds = 10,000-1,000-2,000*45%=8,100 USD |
| cashAvailableForWithdrawal | Double | 1233662.1 | Cash available for withdrawal from the current account |
| cashBalance | Double | 469140.39 | Current cash balance. Current cash balance is the sum of cash balances of all currencies. If you have incurred financing or borrowing, please note that interest is usually calculated on a daily basis, settled monthly, and the specific calculation method depends on the number of financing days. Daily accumulation, deduction around the 5th of the next month, so before deduction of interest, the cash balance you see is not deducted, if the cash balance before deduction of interest is zero, it may result in a negative balance after deduction, i.e., the cash balance becomes negative |
| grossPositionValue | Double | 865644.18 | Total value of securities, the sum of market value of all securities held in the account, i.e., the total market value of all positions. Algorithm, sum of market value of securities; Note: All position market values will be calculated in the main currency; Example 1, if Little Tiger holds market value of 3,000 USD of apples (i.e., long position) at the same time, holding market value of -1,000 USD of Google (i.e., short position), Little Tiger's total securities value = 3,000 USD apples + (-1,000 USD Google) = 2,000 USD; Example 2, Little Tiger holds market value of 10,000 USD of apples, market value of 5,000 USD of apple call options, Little Tiger's total securities value = 10,000+5,000=15,000 USD |
| initMargin | Double | 292046.91 | Initial margin. The sum of initial margin requirements for all positions held in the current account. When executing the first transaction, only when the equity with loan is greater than the initial margin requirement is allowed to open a position. To meet the margin requirements of regulatory authorities, we will increase the initial margin and maintenance margin requirements to the minimum 50% just before the close of trading |
| maintainMargin | Double | 273170.84 | Maintenance margin. The sum of maintenance margin requirements for all positions held in the current account. When holding positions, when the equity with loan is less than the maintenance margin requirement, forced liquidation will occur. To meet the margin requirements of regulatory authorities, we will increase the initial margin and maintenance margin requirements to the minimum 50% just before the close of trading |
| overnightMargin | Double | 273170.84 | Overnight margin. Overnight margin is checked just before the close of trading to determine the margin required for the account. To meet the margin requirements of regulatory authorities, we will increase the initial margin and maintenance margin requirements to the minimum 50% just before the close of trading. The overnight margin ratio of Tiger International is above 50%. If the account's equity with loan is less than the overnight margin, there is a risk of forced liquidation before the close of trading. Algorithm, ∑(maintenance margin of individual stocks held overnight) |
| excessLiquidation | Double | 960492.09 | Current remaining liquidity. Current remaining liquidity is an indicator of the potential risk of forced liquidation of the current account. The higher the current remaining liquidity, the higher the risk of forced liquidation of the account. When less than 0, forced liquidation will occur. The specific algorithm is: current remaining liquidity = equity with loan (equityWithLoan) - account maintenance margin (maintainMargin). To meet the margin requirements of regulatory authorities, we will increase the initial margin and maintenance margin requirements to the minimum 50% just before the close of trading |
| overnightLiquidation | Double | 1233662.93 | Overnight remaining liquidity. Overnight remaining liquidity is calculated using equity with loan (equityWithLoan) - overnight margin (overnightMargin). To meet the margin requirements of regulatory authorities, we will increase the initial margin and maintenance margin requirements to the minimum 50% just before the close of trading. If the overnight remaining liquidity of the account is less than 0, there is a risk of forced liquidation of part of the position before the close of trading. If your account is forced to liquidate, it will be sold at market price when forced liquidation occurs, and the object of forced liquidation will be determined by the broker. Please note the risk control value and leverage indicators |
| netLiquidation | Double | 1233662.93 | Total assets (net liquidation value). Total assets are the sum of net liquidation cash balance and total market value of securities in our account, usually used to represent how much assets are currently in the account. Algorithm, total assets = market value of securities + cash balance + accrued dividends - accrued interest; Example: Little Tiger has 1,000 USD in cash, holding a position worth 1,000 USD of apples (i.e., long position), no dividends and financing interest and no interest deduction, then Little Tiger's total assets = cash 1,000 + position value 1,000 = 2,000 USD. If Little Tiger has 1,000 USD in cash, short selling 1,000 USD of apples, then the market value of securities -1,000 USD, cash 2,000 USD, user total assets = cash 2,000 + (position market value -1,000), account total assets are 1,000 USD |
| equityWithLoan | Double | 1233078.69 | Equity with loan, i.e., ELV, ELV is used as a data indicator for opening and closing positions; Algorithm, cash account = cash balance, margin account = cash balance + market value of securities - US stock option market value; ELV = total assets - US stock option market value |
| realizedPL | Double | -248.72 | Realized P&L for the day (only for futures, calculated from all un-settled orders) |
| totalTodayPL | Double | 0.0 | Total P&L for the day |
| unrealizedPL | Double | -17039.09 | Position P&L. Definition, unrealized P&L for individual stocks and derivatives; Algorithm, current price * number of shares - position cost |
| leverage | Double | 0.5 | Leverage. Leverage is an important indicator to measure the risk level of the account. It helps users quickly understand the financing ratio and risk level of the account. Algorithm, leverage = sum of absolute value of market value of securities / total assets; Note 1, maximum leverage of 4 times for margin accounts in a day, 2 times overnight; Note 2, Tiger considers historical volatility, liquidity, and risk factors, not every stock can be bought at 4 times leverage, generally speaking, the margin ratio for long position is between 25%-100%, the stock with a margin ratio of 25% can be understood as 4 times leverage, the stock with a margin ratio of 100% can be understood as 0 times leverage, i.e., all cash is used for purchase. Note 3, the margin ratio for short position may be greater than 100%. Note 4, the margin ratio for individual stocks can be checked on "Stock Details Page-Quotation Area-Click on Margin Trading Identifier"; Example, Little Tiger's total assets are 100,000 USD, wants to buy apples, the current individual long initial margin ratio of apples is 50% (1/50%=2 times leverage), Little Tiger can only buy 200,000 USD worth of apple stock; Little Tiger wants to short sell Google, the short selling margin ratio is 200%, Little Tiger can short sell 10/200%=50,000 USD worth of Google stock; Little Tiger wants to buy Microsoft, the initial margin ratio is 100% (1/100%=1 times leverage), Little Tiger can only buy 100,000 USD worth of Microsoft stock |
| currencyAssets | CurrencyAssets | Account asset information by transaction currency. Detailed description below | |
| consolidatedSegTypes | string | Aggregated Segment, currently only SEC and FUND will be aggregated. The following fields are for aggregated Segment values: cashAvailableForTrade, initMargin, maintainMargin, overnightMargin, excessLiquidation, overnightLiquidation, buyingPower, lockedFunds, leverage | |
| lockedFunds | Double | 0.0 | Locked assets |
| uncollected | Double | 0.0 | In transit funds |
PrimeAssetItem.CurrencyAssets Description:
| Name | Example | Description |
|---|---|---|
| currency | USD | Current currency of the currency, commonly used currencies include: USD-US dollars, HKD-Hong Kong dollars, SGD-Singapore dollars, CNH-Renminbi |
| cashBalance | 469140.39 | Cash available for trading, plus cash locked (e.g., stocks purchased but not yet settled, other situations may also lock cash) |
| cashAvailableForTrade | 0.1273896 | Cash available for trading from the current account |
Example
PrimeAssetRequest assetRequest = PrimeAssetRequest.buildPrimeAssetRequest("572386", Currency.USD);
assetRequest.setConsolidated(Boolean.TRUE);
PrimeAssetResponse primeAssetResponse = client.execute(assetRequest);
// Query asset information related to securities
PrimeAssetItem.Segment segment = primeAssetResponse.getSegment(Category.S);
System.out.println("segment: " + JSONObject.toJSONString(segment));
// Query asset information related to USD in the account
if (segment != null) {
PrimeAssetItem.CurrencyAssets assetByCurrency = segment.getAssetByCurrency(Currency.USD);
System.out.println("assetByCurrency: " + JSONObject.toJSONString(assetByCurrency));
}Return Example
{
"code":0,
"data":{
"accountId":"572386",
"segments":[
{
"buyingPower":878.52,
"capability":"CASH",
"cashAvailableForTrade":878.52,
"cashBalance":6850.79,
"category":"S",
"consolidatedSegTypes":[
"SEC",
"FUND"
],
"currency":"USD",
"currencyAssets":[
{
"cashAvailableForTrade":35.89,
"cashBalance":6008.16,
"currency":"USD"
},
{
"cashAvailableForTrade":5351.53,
"cashBalance":5351.53,
"currency":"HKD"
},
{
"cashAvailableForTrade":1123.95,
"cashBalance":1123.95,
"currency":"CNH"
},
{
"cashAvailableForTrade":0.12,
"cashBalance":0.12,
"currency":"EUR"
}
],
"equityWithLoan":8891.76,
"excessLiquidation":6850.79,
"grossPositionValue":438.78,
"initMargin":2040.96,
"leverage":0.23,
"maintainMargin":2040.96,
"netLiquidation":7289.57,
"overnightLiquidation":6850.79,
"overnightMargin":2040.96,
"realizedPL":0,
"unrealizedPL":73.29
},
{
"buyingPower":878.52,
"capability":"CASH",
"cashAvailableForTrade":878.52,
"cashBalance":0,
"category":"F",
"consolidatedSegTypes":[
"SEC",
"FUND"
],
"currency":"USD",
"currencyAssets":[
{
"cashAvailableForTrade":0,
"cashBalance":0,
"currency":"USD"
},
{
"cashAvailableForTrade":0,
"cashBalance":0,
"currency":"HKD"
},
{
"cashAvailableForTrade":0,
"cashBalance":0,
"currency":"CNH"
}
],
"equityWithLoan":8891.76,
"excessLiquidation":6850.79,
"grossPositionValue":1602.18,
"initMargin":2040.96,
"leverage":0.23,
"maintainMargin":2040.96,
"netLiquidation":1602.18,
"overnightLiquidation":6850.79,
"overnightMargin":2040.96,
"realizedPL":1.25,
"unrealizedPL":89.35
}
],
"updateTimestamp":1704355652720
},
"message":"success",
"sign":"ZBp+e3IAcPbujB/BIijAh9F1PXQaIiqn5pxldBTPdz88W/hz6rezJsnmuvG+kLbieBWmRiVCt5Ah3eTM9ynLK4BZjRixo2OGJ0XcKotZf0qGDAF3E34acQSbH1te6xCEZMeDunptXNGUcveTgNW2dscLt121MtsLwoXh8T5bUS0=",
"success":true,
"timestamp":1704355652720
}Prime/Paper Trading Account Asset History Analysis Data Query
Corresponding request class: PrimeAnalyticsAssetRequest
Description
Retrieve historical asset analysis for prime/paper trading accounts
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized fund account: 123123 |
| start_date | string | No | Start date, format yyyy-MM-dd, e.g. '2022-01-01'. If not provided, the date 30 days before end_date will be used |
| end_date | string | No | End date, format yyyy-MM-dd, e.g. '2022-02-01'. If not provided, the current date will be used |
| seg_type | SegmentType | No | Type of account segmentation, possible values: SegmentType.SEC represents securities; SegmentType.FUT represents futures |
| currency | Currency | No | Currency, including ALL/USD/HKD/CNH |
| sub_account | str | No | Sub-account (only applicable to institutional accounts), if this field is passed, the assets of this sub-account will be returned |
| secret_key | string | No | Institutional user-specific, trader key. Configured in ClientConfig.DEFAULT_CONFIG, personal developers do not need to specify |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.PrimeAnalyticsAssetResponse
PrimeAnalyticsAssetItem.Summary summary can be obtained with PrimeAnalyticsAssetItem.Summary summary = primeAssetResponse.getSummary() to get asset analysis summary data;
Use List<PrimeAnalyticsAssetItem.HistoryItem> historyItems = primeAssetResponse.getHistory() to get historical asset list. See example code for details
PrimeAnalyticsAssetItem.Summary Description:
| Name | Type | Description |
|---|---|---|
| pnl | double | Profit and loss amount |
| pnlPercentage | double | Rate of return |
| annualizedReturn | double | Annualized return (calculated) |
| overUserPercentage | double | Percentage of users exceeding |
PrimeAnalyticsAssetItem.HistoryItem Description:
| Name | Example | Description |
|---|---|---|
| date | long | Timestamp in milliseconds |
| pnl | double | Profit and loss amount compared to the previous day |
| pnlPercentage | double | Rate of return compared to the previous day |
| asset | double | Total asset amount |
| cashBalance | double | Cash balance |
| grossPositionValue | double | Market value |
| deposit | double | Deposit amount |
| withdrawal | double | Withdrawal amount |
Example
PrimeAnalyticsAssetRequest assetRequest = PrimeAnalyticsAssetRequest.buildPrimeAnalyticsAssetRequest(
"402901").segType(SegmentType.SEC).startDate("2021-12-01").endDate("2021-12-07");
PrimeAnalyticsAssetResponse primeAssetResponse = client.execute(assetRequest);
if (primeAssetResponse.isSuccess()) {
JSONObject.toJSONString(primeAssetResponse.getSummary());
JSONObject.toJSONString(primeAssetResponse.getHistory());
}Return Example
{
"code":0,
"message":"success",
"timestamp":1657616435212,
"data":{
"summary":{
"pnl":691.18,
"pnlPercentage":0,
"annualizedReturn":0,
"overUserPercentage":0
},
"history":[
{
"date":1638334800000,
"asset":48827609.65,
"pnl":0,
"pnlPercentage":0,
"cashBalance":48811698.59,
"grossPositionValue":15911.06,
"deposit":0,
"withdrawal":0
},
{
"date":1638421200000,
"asset":48827687.69,
"pnl":78.04,
"pnlPercentage":0,
"cashBalance":48811698.59,
"grossPositionValue":15989.1,
"deposit":0,
"withdrawal":0
},
{
"date":1638507600000,
"asset":48827583.18,
"pnl":-26.47,
"pnlPercentage":0,
"cashBalance":48811698.59,
"grossPositionValue":15884.58,
"deposit":0,
"withdrawal":0
},
{
"date":1638766800000,
"asset":48827804.28,
"pnl":194.63,
"pnlPercentage":0,
"cashBalance":48811698.59,
"grossPositionValue":16105.68,
"deposit":0,
"withdrawal":0
},
{
"date":1638853200000,
"asset":48828300.83,
"pnl":691.18,
"pnlPercentage":0,
"cashBalance":48811723,
"grossPositionValue":16577.82,
"deposit":0,
"withdrawal":0
}
]
},
"sign":"BFcQVHP4Rh0WAoQMAkVErZq1LKLlhPHx5X+77xNjpsIJF62Zr3T8UXDNvT3fSRA/Pt8cV8Ju3scYq/ollZU169ckh7rVpmeXSxJBaJ8Wfq5tOex7K1BkyHVEcH8i1c6aSph00Nm1yUqcTss/jVvN8uAXYoIBFCELV9nu7r1T4wA="
}Prime/Paper Trading Account Asset Transferable Funds Query
Corresponding request class: SegmentFundAvailableRequest
Description
Retrieve transferable funds for the account in the corresponding Segment
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account, including prime, paper trading account |
| from_segment | string | Yes | Transfer segment, FUT or SEC |
| currency | string | No | Transfer currency, USD or HKD |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.SegmentFundAvailableResponse
SegmentFundAvailableItem items can be obtained with List<SegmentFundAvailableItem> items = response.getSegmentFundAvailableItems() to get the list of transferable funds for each Segment.
See example code for details
SegmentFundAvailableItem Description:
| Name | Type | Description |
|---|---|---|
| fromSegment | string | Transfer segment, FUT or SEC |
| currency | string | Transfer currency, USD or HKD |
| amount | double | Transferable funds, in the unit of the corresponding currency |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
SegmentFundAvailableRequest request = SegmentFundAvailableRequest.buildRequest(
SegmentType.SEC, Currency.HKD);
SegmentFundAvailableResponse response = client.execute(request);
System.out.println(JSONObject.toJSONString(response));
// Get specific data
for (SegmentFundAvailableItem item : response.getSegmentFundAvailableItems()) {
System.out.println(JSONObject.toJSONString(item));
}Return Example
{
"code": 0,
"data": [
{
"amount": 17607412.84,
"currency": "HKD",
"fromSegment": "SEC"
}
],
"message": "success",
"sign": "jbxGKQiv5staJJOsN9CnMz25TxWk9jq6iZLksLg09aeP60QfFoSkNIGrnwdv3x0cgYc+SHj6vWdJGQ8FRo/DubxR6pyb6N6iiLl+TANQkvct0MERk7nygEhvQiYXD2q5gj2jPuDAfS6fVzkrYLWEaXQp3RrfqBDNJj+TRVhLRiw=",
"success": true,
"timestamp": 1679902705608
}Prime/Paper Trading Account Internal Funds Transfer
Corresponding request class: SegmentFundTransferRequest
Description
Transfer funds between different segments of the account, such as from the securities segment to the futures segment
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account, including prime, paper trading account |
| from_segment | string | Yes | Transfer segment, FUT or SEC |
| to_segment | string | Yes | Transfer segment, FUT or SEC, must be different from from_segment |
| currency | string | Yes | Transfer currency, USD or HKD |
| amount | double | Yes | Transfer amount, in the unit of the corresponding currency |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.SegmentFundResponse
SegmentFundItem item can be obtained with SegmentFundItem item = response.getSegmentFundItem() to get the transfer result object.
See example code for details
SegmentFundItem Description:
| Name | Type | Description |
|---|---|---|
| id | long | Transfer record ID |
| fromSegment | string | Transfer segment, FUT or SEC |
| toSegment | string | Transfer segment, FUT or SEC |
| currency | string | Transfer currency, USD or HKD |
| amount | double | Transfer amount, in the unit of the corresponding currency |
| status | string | Status (NEW/PROC/SUCC/FAIL/CANC) |
| statusDesc | string | Status description (Submitted/Processing/Credited/Transfer failed/Cancelled) |
| message | string | Failure information |
| settledAt | long | Timestamp of credit |
| updatedAt | long | Update timestamp |
| createdAt | long | Create timestamp |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
SegmentFundTransferRequest request = SegmentFundTransferRequest.buildRequest(
SegmentType.SEC, SegmentType.FUT, Currency.HKD, 1000D);
SegmentFundResponse response = client.execute(request);
System.out.println(JSONObject.toJSONString(response));Return Example
{
"code":0,
"data":{
"amount":1000,
"createdAt":1680076000672,
"currency":"HKD",
"fromSegment":"SEC",
"id":30300805635506176,
"status":"NEW",
"statusDesc":"committed",
"toSegment":"FUT",
"updatedAt":1680076000672
},
"message":"success",
"sign":"eBhM+F2Kmc1QA0LX5R5yAoz/Ugi1kizUFjjaY378zsXPj69XkMunOOmmOcUR0evo/toHIG1Scd4AlVameVDE7SWQsVt6B+L7UBjI1iU9top79ewxbXkGTc/e4ketQgHfqqF9aR/eHIdZRZjKOvNEdfWfjzKTmQJiAaHhXNVfFJ0=",
"success":true,
"timestamp":1680076000819
}Prime/Paper Trading Account Cancel Internal Funds Transfer
Corresponding request class: SegmentFundCancelRequest
Description
Cancel the submitted funds transfer. If the transfer has been successful, it cannot be canceled. It can be exchanged back to the opposite segment.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account, including prime, paper trading account |
| id | long | Yes | Transfer record ID |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.SegmentFundResponse
SegmentFundItem item can be obtained with SegmentFundItem item = response.getSegmentFundItem() to get the cancellation transfer result object.
See example code for details
SegmentFundItem Description:
| Name | Type | Description |
|---|---|---|
| id | long | Transfer record ID |
| fromSegment | string | Transfer segment, FUT or SEC |
| toSegment | string | Transfer segment, FUT or SEC |
| currency | string | Transfer currency, USD or HKD |
| amount | double | Transfer amount, in the unit of the corresponding currency |
| status | string | Status (NEW/PROC/SUCC/FAIL/CANC) |
| statusDesc | string | Status description (Submitted/Processing/Credited/Transfer failed/Cancelled) |
| message | string | Failure information |
| settledAt | long | Timestamp of credit |
| updatedAt | long | Update timestamp |
| createdAt | long | Create timestamp |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
SegmentFundCancelRequest request = SegmentFundCancelRequest.buildRequest(30300805635506176L);
SegmentFundResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("cancel fail." + JSONObject.toJSONString(response));
}Return Example
{
"code":1200,
"message":"standard account response error(fail:The transfer cannot be cancelled now)",
"timestamp":1680077452633
}Prime/Paper Trading Account Internal Funds Transfer History Query
Corresponding request class: SegmentFundHistoryRequest
Description
Query historical transfer records between different Segments of the account. Ordered by time
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | string | Yes | User's authorized account, including prime, paper trading account |
| limit | Integer | No | Number of recent transfer records to return. Default is 100, maximum 500 |
Return
com.tigerbrokers.stock.openapi.client.https.response.trade.SegmentFundsResponse
SegmentFundItem items can be obtained with List<SegmentFundItem> items = response.getSegmentFundItems() to get the list of transfer records between different Segments. See example code for details
SegmentFundItem Description:
| Name | Type | Description |
|---|---|---|
| id | long | Transfer record ID |
| fromSegment | string | Transfer segment, FUT or SEC |
| toSegment | string | Transfer segment, FUT or SEC |
| currency | string | Transfer currency, USD or HKD |
| amount | double | Transfer amount, in the unit of the corresponding currency |
| status | string | Status (NEW/PROC/SUCC/FAIL/CANC) |
| statusDesc | string | Status description (Submitted/Processing/Credited/Transfer failed/Cancelled) |
| message | string | Failure information |
| settledAt | long | Timestamp of credit |
| updatedAt | long | Update timestamp |
| createdAt | long | Create timestamp |
Example
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
ClientConfig.DEFAULT_CONFIG);
SegmentFundHistoryRequest request = SegmentFundHistoryRequest.buildRequest(30);
SegmentFundsResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("cancel fail." + JSONObject.toJSONString(response));
}Return Example
{
"code":0,
"data":[
{
"amount":1000,
"createdAt":1680076001000,
"currency":"HKD",
"fromSegment":"SEC",
"id":30300805635506176,
"settledAt":1680076001000,
"status":"SUCC",
"statusDesc":"已到账",
"toSegment":"FUT",
"updatedAt":1680076001000
},
{
"amount":1000,
"createdAt":1679307031000,
"currency":"HKD",
"fromSegment":"SEC",
"id":30200015261794304,
"settledAt":1679307032000,
"status":"SUCC",
"statusDesc":"已到账",
"toSegment":"FUT",
"updatedAt":1679307031000
}
],
"message":"success",
"sign":"g9B9Q20F56qoUVs1ULaWZMC5h1DYp7E7GeQnkd2TR5tw2R85TnO7xVb79sqB4EFZEEtI+So8gqh71hABiz31VrQy32zGmYGSgFA94jI6sFh4//BJA0IG9vGx1PmO/rv9aomK+17XGJ4PDrqxHBuGczaX4i65Wvoyt5wHdAx2qoU=",
"success":true,
"timestamp":1680085312913
}Get Maximum Tradable Quantity
Corresponding request class: EstimateTradableQuantityRequest
Description
Query the maximum tradable quantity for a specific target under the account, supporting stocks and options, but not futures.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | String | Yes | Account, currently only supports consolidated accounts |
| symbol | String | Yes | Stock symbol |
| expiry | String | No | Expiry date, must be provided when the transaction type is OPT/WAR/IOPT |
| right | String | No | CALL/PUT, must be provided when the transaction type is OPT/WAR/IOPT |
| strike | String | No | Strike price, must be provided when the transaction type is OPT/WAR/IOPT |
| seg_type | SegmentType | No | SEC, currently only SEC is supported |
| sec_type | SecType | No | STK: stock/FUT: futures/OPT: options/WAR: warrants/IOPT: bull-bear, futures are not supported temporarily |
| action | ActionType | Yes | Transaction direction BUY/SELL |
| order_type | OrderType | Yes | Order type |
| limit_price | double | No | Limit price, required when order_type is LMT,STP_LMT |
| stop_price | double | No | Stop loss price, required when order_type is STP,STP_LMT |
| secretKey | String | No | Institutional user-specific, trader key |
Return
| Field | Type | Description |
|---|---|---|
| tradableQuantity | Double | Cash tradable quantity (if action is BUY, return tradable quantity, otherwise return sellable quantity) |
| financingQuantity | Double | Financing and margin trading tradable quantity (not applicable to cash accounts) |
| positionQuantity | Double | Position quantity |
| tradablePositionQuantity | Double | Tradable position quantity |
Example
EstimateTradableQuantityRequest request = EstimateTradableQuantityRequest.buildRequest(
SecType.STK, "AAPL", ActionType.BUY, OrderType.LMT, 150D, null);
EstimateTradableQuantityResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("fail." + JSONObject.toJSONString(response));
}Return Example
{
"code":0,
"data":{
"positionQuantity":1,
"tradablePositionQuantity":1,
"tradableQuantity":45
},
"message":"success",
"sign":"mBmBqdIum+F8PE9yHis8v64My2P9rBorsYwtLNAr/Hei6oRedvl5YyfBV2H9zHUHOYcJJDukrD74IfnUsJW1PS6YUQdt+MirNc3Bm51gMrjiVFed8JTto4wRqXvuX57wcA3gMCLVDJkbqjU5VD64cCl28A38N8vdgRo7HgcS8pM=",
"success":true,
"timestamp":1681789228649
}Get Deposit and Withdrawal Records
Corresponding request class: DepositWithdrawRequest
Description
Query deposit and withdrawal records for the account
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | String | Yes | Account, currently only supports consolidated accounts |
| secretKey | String | No | Institutional user-specific, trader key |
| lang | Language | No | Language enumeration value: en_US, zh_CN, zh_TW, default: en_US, see Language Enumeration for details |
Return
| Field | Type | Description |
|---|---|---|
| id | long | ID |
| refId | string | Associated business ID |
| type | int | Type of funds (1: deposit; 3: withdrawal; 20: withdrawal fee; 21: withdrawal refund; 22: withdrawal failure-refund; 23: withdrawal fee-refund) |
| typeDesc | string | Description of fund type |
| currency | string | Currency |
| amount | double | Amount |
| businessDate | string | Business date |
| completedStatus | bool | Whether completed |
| createdAt | long | Create timestamp |
| updatedAt | long | Update timestamp |
Example
DepositWithdrawRequest request = DepositWithdrawRequest.newRequest();
request.lang(Language.en_US);
DepositWithdrawResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("fail." + JSONObject.toJSONString(response));
}Return Example
{
"code": 0,
"data": [
{
"amount": 3000,
"businessDate": "2024/11/15",
"completedStatus": true,
"createdAt": 1731663420532,
"currency": "SGD",
"id": 24924145879575127,
"refId": "TEST_API-37062471908982784",
"type": 1,
"typeDesc": "Deposit",
"updatedAt": 1731663420532
},
{
"amount": 300000,
"businessDate": "2024/11/15",
"completedStatus": true,
"createdAt": 1731664787127,
"currency": "USD",
"id": 24924145879575129,
"refId": "TEST_API-37062651031584768",
"type": 1,
"typeDesc": "Deposit",
"updatedAt": 1731664787127
}
],
"message": "success",
"sign": "LTccL5hUIEYzqmQsev2X8gVzwlEJar8/ybIUHMNd9H6K48XrJiG2LgC17GvFhVy1lKUabrV2GZ9YsBvJQlEoDEe1d6EtnbBWn7bAMdJktsUhlAxJiEqS/aVIIdGe6u7Fo/laKqmxx5n1caYIVaU17TvJxjHufD7pfkoPbOoWwbM=",
"success": true,
"timestamp": 1735134267185
}Get Fund Details
Corresponding request class: FundDetailsRequest
Description
Retrieve fund details
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| segTypes | List<String> | Yes | List of segment types, e.g.: ["SEC", "FUT"] |
| account | String | Yes | Account, currently only supports consolidated accounts |
| fundType | FundType | No | Type of funds, including: ALL all, DEPOSIT_WITHDRAW deposit and withdrawal, TRADE trading, FEE fees, FUNDS_TRANSFER funds transfer, FOREX foreign exchange, CORPORATE_ACTION corporate actions, ACTIVITY_AWARD activities, OTHER other. Default ALL |
| currency | String | No | Currency |
| startDate | String | No | Start date, format yyyy-MM-dd |
| endDate | String | No | End date, format yyyy-MM-dd |
| start | Long | No | Start serial number, starting from 0, e.g., if limit is set to 50, the first two pages return 100 records, then start needs to be 100 when requesting the 3rd page, i.e., continue from the 101st record |
| limit | Long | No | Maximum number of records to return, default 50, maximum 100 |
| secretKey | String | No | Institutional user-specific, trader key |
| lang | Language | No | Language enumeration value: en_US, zh_CN, zh_TW, default: en_US, see Language Enumeration for details |
Return
| Field | Type | Description |
|---|---|---|
| id | Long | Record ID |
| desc | String | Description |
| currency | String | Currency |
| segType | String | Segment type |
| type | String | Type of funds |
| amount | Double | Amount |
| businessDate | String | Business date defined by Tiger, all market funds changes for the same trading day will be recorded in the same business date |
| updatedAt | Long | Timestamp of flow update |
| page | Integer | Current page number |
| limit | Integer | Number of records per page |
| itemCount | Integer | Total number of records |
| pageCount | Integer | Total number of pages |
| timestamp | Long | Timestamp |
| contractName | String | Contract name |
Example
FundDetailsRequest request = FundDetailsRequest.buildFundDetailsRequest(account,
Lists.newArrayList(SegmentType.SEC.name()), 0L, 5L);
request.setCurrency("HKD");
request.setFundType("ALL");
request.setStartDate("2025-01-01");
request.setEndDate("2025-04-01");
FundDetailsResponse response = client.execute(request);
if (response.isSuccess()) {
System.out.println(JSONObject.toJSONString(response));
} else {
System.out.println("fail." + JSONObject.toJSONString(response));
}Return Example
{
"code": 0,
"message": "success",
"timestamp": 1745840017490,
"data": {
"page": 1,
"limit": 5,
"itemCount": 5,
"pageCount": 1,
"timestamp": 1745840017495,
"items": [
{
"id": "3969803304",
"currency": "HKD",
"type": "Internal Funds Transfer Out",
"segType": "SEC",
"amount": -1,
"businessDate": "2025-03-25",
"updatedAt": 1742875771000
},
{
"id": "3942009038",
"currency": "HKD",
"type": "Financing Tnterest",
"segType": "SEC",
"amount": -2.43,
"businessDate": "2025-03-06",
"updatedAt": 1741247923000
},
{
"id": "3897595901",
"currency": "HKD",
"type": "Financing Tnterest",
"segType": "SEC",
"amount": -2.67,
"businessDate": "2025-02-06",
"updatedAt": 1738828190000
},
{
"id": "3877434674",
"currency": "HKD",
"type": "Currency Exchange - Quotation Currency",
"segType": "SEC",
"amount": 7.77,
"businessDate": "2025-01-17",
"updatedAt": 1737117790000
},
{
"id": "3865693144",
"currency": "HKD",
"type": "Financing Tnterest",
"segType": "SEC",
"amount": -2.75,
"businessDate": "2025-01-07",
"updatedAt": 1736236455000
}
]
}
}Updated 1 day ago
