Fund Management
All methods on this page require trading-account permission, use the configured account, and return the response data as web::json::value. Transfers and FX orders affect the live account, so query available funds first.
Get Segment Transfer History
value TradeClient::get_segment_fund_history(int limit = 0)
Description
Returns fund-transfer records between account segments.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | int | No | SDK default 0; sent only when positive |
Return
web::json::value array. Each record contains id, fromSegment, toSegment, currency, amount, status, statusDesc, settledAt, createdAt, and updatedAt.
Example
auto result = trade_client.get_segment_fund_history(20);Permissions and Limits
Uses the configured account. With limit = 0, the server selects the record count. Fund-query permission is required.
Get Transferable Funds
value TradeClient::get_segment_fund_available(utility::string_t from_segment, utility::string_t currency = U("USD"))
Description
Returns currently transferable funds for one segment and currency.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from_segment | utility::string_t | Yes | Source segment, such as U("SEC") or U("FUT") |
| currency | utility::string_t | No | SDK default U("USD") |
Return
web::json::value array. Each item contains fromSegment, currency, and amount.
Example
auto result = trade_client.get_segment_fund_available(U("SEC"), U("USD"));Permissions and Limits
The account must support the source segment. Available funds change with positions and margin.
Transfer Segment Funds
value TradeClient::transfer_segment_fund(utility::string_t from_segment, utility::string_t to_segment, double amount, utility::string_t currency = U("USD"))
Description
Submits a fund transfer between two segments of the configured account.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| from_segment | utility::string_t | Yes | Source segment |
| to_segment | utility::string_t | Yes | Different target segment |
| amount | double | Yes | Positive and no greater than transferable funds |
| currency | utility::string_t | No | SDK default U("USD") |
Return
web::json::value object with id, fromSegment, toSegment, currency, amount, status, statusDesc, message, settledAt, createdAt, and updatedAt.
Example
auto result = trade_client.transfer_segment_fund(U("SEC"), U("FUT"), 1000.0);Permissions and Limits
This changes live funds. Call get_segment_fund_available first and query history for final status.
Cancel a Segment Transfer
value TradeClient::cancel_segment_fund(long long id)
Description
Cancels a segment transfer that remains pending.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | long long | Yes | Transfer ID returned by get_segment_fund_history |
Return
web::json::value object with the same fields as the segment-transfer result.
Example
auto result = trade_client.cancel_segment_fund(12345);Permissions and Limits
Only records the server still marks cancelable can be canceled.
Place an FX Order
value TradeClient::place_forex_order(utility::string_t seg_type, utility::string_t source_currency, utility::string_t target_currency, double source_amount)
Description
Submits an account-segment FX order by source amount.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_type | utility::string_t | Yes | Account segment, such as U("SEC") |
| source_currency | utility::string_t | Yes | Three-letter source currency |
| target_currency | utility::string_t | Yes | Different three-letter target currency |
| source_amount | double | Yes | Positive and no greater than available funds |
Return
web::json::value object with id, status, sourceCurrency, targetCurrency, sourceAmount, targetAmount, rate, and submitTime.
Example
auto result = trade_client.place_forex_order(U("SEC"), U("USD"), U("HKD"), 100.0);Permissions and Limits
The account must support both currencies and FX. The response contains the resulting rate and execution status.
Get Aggregate Assets
value TradeClient::get_aggregate_assets(utility::string_t account = U(""), utility::string_t seg_type = U(""), utility::string_t base_currency = U(""))
Description
Returns aggregate assets by account, segment, and base currency.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| account | utility::string_t | No | Empty uses the configured account |
| seg_type | utility::string_t | No | SDK default is an empty string; omitted when empty |
| base_currency | utility::string_t | No | SDK default is an empty string; omitted when empty |
Return
web::json::value object with currency, cashBalance, cashBalanceWithInTransit, equityWithLoan, netLiquidation, initMargin, maintainMargin, tradeCurrencyMargin, intradayRiskRatio, grossPositionValue, optionMarketValue, stockMarketValue, cashAvailableForTrade, availableCash, lockedFunds, lockedCash, creditLimit, excessEquity, and excessLiquidity.
Example
auto result = trade_client.get_aggregate_assets(U(""), U("SEC"), U("USD"));Permissions and Limits
Asset-query permission is required. Fields depend on account type and segment capability.
Rate Limit
- Base rate: 60 requests per minute (counted per TigerId and interface in a 60-second rolling window).
Get Funding History
value TradeClient::get_funding_history(utility::string_t seg_type = U(""))
Description
Returns deposit and withdrawal records for the configured account.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_type | utility::string_t | No | SDK default is an empty string; omitted when empty |
Return
web::json::value array. Each record contains id, refId, type, typeDesc, currency, amount, businessDate, status, statusDesc, completedStatus, createdAt, and updatedAt.
Example
auto result = trade_client.get_funding_history(U("SEC"));Permissions and Limits
Only records visible to the configured account are returned.
Rate Limit
- Base rate: 60 requests per minute (counted per TigerId and interface in a 60-second rolling window).
Get Fund Details
value TradeClient::get_fund_details(const value &seg_types = value::null(), utility::string_t account = U(""), utility::string_t fund_type = U(""), utility::string_t currency = U(""), int start = 0, int limit = 0, utility::string_t start_date = U(""), utility::string_t end_date = U(""))
Description
Returns paginated fund details filtered by segments, type, currency, and date.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| seg_types | const value& | No | JSON segment array; SDK default value::null() |
| account | utility::string_t | No | Empty uses the configured account |
| fund_type | utility::string_t | No | Fund type; SDK default is empty |
| currency | utility::string_t | No | Three-letter currency; SDK default is empty |
| start | int | No | Pagination start; SDK default 0 |
| limit | int | No | Count; SDK default 0 for server handling |
| start_date | utility::string_t | No | yyyy-MM-dd; SDK default is empty |
| end_date | utility::string_t | No | yyyy-MM-dd; must not precede start |
Return
web::json::value pagination object with page, limit, itemCount, pageCount, timestamp, and items. Each item contains id, account, segType, fundType, currency, amount, balance, occurTime, remark, and externalId.
Example
web::json::value segments = web::json::value::array();
segments[0] = web::json::value::string(U("SEC"));
auto result = trade_client.get_fund_details(
segments, U(""), U("DEPOSIT"), U("USD"), 0, 50,
U("2025-01-01"), U("2025-12-31"));Permissions and Limits
The server validates account, segments, date range, and pagination limits.
Limits and Links
The server validates account type, currency, segment, and cancellation state. See API Rate Limits and Assets and Positions.
See the public C++ SDK repository for API definitions and release updates.
Rate Limit
- Base rate: 10 requests per minute (counted per TigerId and interface in a 60-second rolling window).
Updated about 1 month ago
