Get Account Information
get_accounts Get Managed Accounts
TradeClient.get_accounts()
Description
Fetch a list of managed accounts of the current user, along with account information. Institutional account will return master account and all sub-accounts.
Response
list
, each element is a PortfolioAccount
(include/tigerapi/model.h PortfolioAccount)object
Attributes:
Attribute | Type | Description |
---|---|---|
account | utility::string_t | Account identifier |
update_timestamp | long | Last update time |
segments | vector<Segment> | Account financial segments |
Example
int main(int argc, char *args[]) {
/************************** set config **********************/
ClientConfig config = ClientConfig();
config.private_key = "xxxxxx your private key string xxxxxxxx";
config.tiger_id = "your tiger id";
config.account = "your account";
std::shared_ptr<QuoteClient> quote_client = std::make_shared<QuoteClient>(config);
value res = trade_client->get_accounts();
ucout << U("Accounts: ") << res << endl;
return 0;
}
Response Example
{
"items":[
{
"account":"U10010705",
"accountType":"GLOBAL",
"capability":"CASH",
"status":"Funded"
},
{
"account":"572386",
"accountType":"STANDARD",
"capability":"CASH",
"status":"Funded"
},
{
"account":"20200821144442583",
"accountType":"PAPER",
"capability":"RegTMargin",
"status":"Funded"
}
]
}
get_assets Get Account Summary
value get_asset(utility::string_t account = U(""), const value &sub_accounts = value::array(), bool segment = false,
bool market_value = false);
Description
Get account summary,this method is only recommended for Global Account. You can also get the account summary of your standard, or paper trading account using this method. However, because different account types have different account structures, Please use get_prime_assets to get assets for prime and paper acount.
Parameters
Parameter | Typse | Required | Description |
---|---|---|---|
account | utility::string_t | No | Account id |
sub_accounts | list<string> | No | A list of sub-accounts, default value is None |
segment | bool | No | Whether to return data grouped by segments (securities, futures). Default value is False. When set to True, a dict will be returned, where 'C' means futures, 'S' means stocks |
market_value | bool | No | Whether to return data grouped by currency (USD, HKD, RMB). Default is False |
Response
list
Each element of this list is a PortfolioAccount Object。If the user only has one account,there will be only one element in the list returned.
PortfolioAccount(include/tigerapi/model.h) has the following structure。
Please refer to Object for data fields in Account、SecuritySegment、CommoditySegment
PortfolioAccount Object
├── account: account id
├── update_timestamp: Last update time
├── segments: account information grouped by segments
│ ├── buying_power
│ ├── capability
│ ├── cash_available_for_trade
│ ├── cash_available_for_withdrawl
│ ├── cash_balance
│ ├── category
│ ├── currency
│ ├── currency_asset
│ ├── equity_with_loan
│ ├── excess_liquidation
│ ├── gross_position_value
│ ├── init_margin
│ ├── leverage
│ ├── locked_funds
│ ├── maintain_margin
│ ├── net_liquidation
│ ├── overnight_liquidation
│ ├── overnight_margin
│ ├── realized_pl
│ ├── total_today_pl
│ ├── unrealized_pl
└─└── unrealized_plby_cost_of_carry
Example
#include "tigerapi/trade_client.h"
#include "tigerapi/contract_util.h"
#include "tigerapi/order_util.h"
using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;
/**
* Calling TradeClient
*/
class TestTradeClient {
public:
static void test_get_asset(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_asset();
cout << "asset: " << res << endl;
}
static void test_trade(const std::shared_ptr<TradeClient>& trade_client) {
TestTradeClient::test_get_asset(trade_client);
}
};
int main(int argc, char *args[]) {
cout << "Tiger Api main" << endl;
/************************** set config **********************/
ClientConfig config = ClientConfig(true);
config.private_key = "-----BEGIN RSA PRIVATE KEY-----\n"
"xxxxxx private key xxxxxxxx"
"-----END RSA PRIVATE KEY-----";
config.tiger_id = "Tiger ID";
config.account = "Account ID";
/**
* Use TradeClient
*/
std::shared_ptr<TradeClient> trade_client = std::make_shared<TradeClient>(config);
TestTradeClient::test_trade(trade_client);
return 0;
}
Response Example
{
"items":
[
{
"account":"572386",
"buyingPower":8617.0384386000005,
"capability":"CASH",
"cashValue":8617.0384386000005,
"currency":"USD",
"netLiquidation":8829.4388956000003,
"realizedPnL":0,
"segments":
[
{
"account":"572386",
"accruedCash":0,
"accruedDividend":0,
"availableFunds":8617.0384386000005,
"cashValue":8617.0384386000005,
"category":"S",
"equityWithLoan":8829.4388956000003,
"excessLiquidity":8617.0384386000005,
"grossPositionValue":212.40045699999999,
"initMarginReq":212.40045699999999,
"leverage":0.024055900000000002,
"maintMarginReq":212.40045699999999,
"netLiquidation":8829.4388956000003,
"title":"US Securities"
}
],
"unrealizedPnL":-29.7592915
}
]
}
get_prime_assets Account Summary for Prime Account
value get_prime_asset(const utility::string_t & account = U(""), const utility::string_t & base_currency = U("USD"));
value get_prime_asset(const utility::string_t &account, Currency base_currency = Currency::USD);
Description
Get account summary, including asset information and open positions, for your Prime and Paper accounts
Parameters
Parameter | Type | Description |
---|---|---|
account | string_t | account id, if not specified, the request will use default account id configured in client_config |
base_currency | Currency | Currency of assets default: Currency::USD |
Response
list
A list where each element is a PortfolioAccount object. If there is only one account, the method will return a one-element list.
The structure of the PortfolioAccount object is as follows.
For a detailed list of data fields contained in PortfolioAccount and Segment, please refer to Object Information
PortfolioAccount object
├── account: account id
├── update_timestamp: update time, timestamp in milliseconds
├── segments: account information by segments, a dict with the security category as the key, and the value as a Segment object
│ ├── 'S' means securities account, value is Segment object
│ │ ├── currency: currency, such as USD, HKD
│ │ ├── capability: Account Type, Margin: RegTMargin, Cash: Cash
│ │ ├── category': Securities Classification C: (Commodities Futures), S: (Securities Stocks)
│ │ ├── cash_balance': cash that can be traded, plus some cash that has been locked (such as stocks that have been purchased but not yet traded, and some other situations will also have locked cash)
│ │ ├── cash_available_for_trade': The amount of cash and margin that can be traded in the current account
│ │ ├── cash_available_for_withdrawal': The amount of cash that can be withdrawn in the current account
│ │ ├── gross_position_value': total security value: long stock value + short stock value + long option value + short option value. The above items are calculated as absolute values
│ │ ├── equity_with_loan': Equity with loan value (including loan value assets). Securities Segment: Cash value + stock value, Futures Segment: Cash value - maintenance margin
│ │ ├── net_liquidation': net liquidation value
│ │ ├── init_margin': initial margin requirement
│ │ ├── maintain_margin': maintenance margin requirement
│ │ ├── overnight_margin': overnight margin requirement
│ │ ├── unrealized_pl': floating profit and loss
│ │ ├── realized_pl': realized profit and loss
│ │ ├── excess_liquidation': Excess liquidity, used to represent intraday risk value. Calculation method for securities segment: equity_with_loan - maintenance_margin_requirement. Calculation method for futures segment: net_liquidation - maintenance_margin_requirement
│ │ ├── overnight_liquidation': Overnight risk control value, when it is less than 0, account positions will be forced to liquidate, and you need to pay attention to risks
│ │ ├── buying_power': buying power. Estimate how many dollars you can buy in stock assets. The margin account has a maximum of four times the purchasing power of the funds (funds that are not occupited) during the day. Overnight purchasing power Up to two times.
│ │ ├── leverage': The currently leverage, if it is less than 1, it means that the leverage is not used, and if it is greater than 1, it means the leverage multiple used
│ │ ├── currency_assets: Account asset information differentiated by transaction currency, a dict with currency as key
│ │ │ ├── 'USD' means US dollar, value is CurrencyAsset object
│ │ │ │ ├── currency': current currency, commonly used currencies include: USD-US dollar, HKD-Hong Kong dollar, SGD-Singapore dollar, CNH-RMB
│ │ │ │ ├── cash_balance': cash that can be traded, plus some cash that has been locked (such as stocks that have been purchased but not yet traded, and some other situations will also have locked cash)
│ │ │ │ ├── cash_available_for_trade': The amount of cash that can be traded in the current account
│ │ │ │ ├── gross_position_value': gross value
│ │ │ │ ├── stock_market_value': The market value of the stock, when the category is C (futures type), there will be no stock market value
│ │ │ │ ├── futures_market_value': the market value of futures, when the category is S (stock type), there will be no futures market value
│ │ │ │ ├── option_market_value': the market value of the option
│ │ │ │ ├── unrealized_pl': floating profit and loss within the account
│ │ │ │ ├── realized_pl': realized profit and loss in the account
│ │ │ ├── 'HKD' means Hong Kong dollar, value is CurrencyAsset object
│ │ └─ └── 'CNH' means RMB, value is CurrencyAsset object
│ └── 'C' means futures account, value is Segment object
Example
#include "tigerapi/trade_client.h"
#include "tigerapi/contract_util.h"
#include "tigerapi/order_util.h"
using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;
/**
* Calling TradeClient
*/
class TestTradeClient {
public:
static void test_get_prime_asset(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_prime_asset();
cout << "asset: " << res << endl;
}
static void test_trade(const std::shared_ptr<TradeClient>& trade_client) {
TestTradeClient::test_get_prime_asset(trade_client);
}
};
int main(int argc, char *args[]) {
cout << "Tiger Api main" << endl;
/************************** set config **********************/
ClientConfig config = ClientConfig(true);
config.private_key = "-----BEGIN RSA PRIVATE KEY-----\n"
"xxxxxx private key xxxxxxxx"
"-----END RSA PRIVATE KEY-----";
config.tiger_id = "Tiger ID";
config.account = "Account ID";
/**
* Use TradeClient
*/
std::shared_ptr<TradeClient> trade_client = std::make_shared<TradeClient>(config);
TestTradeClient::test_trade(trade_client);
return 0;
}
Response
{
"accountId":"572386",
"segments":
[
{
"buyingPower":8617.0200000000004,
"capability":"CASH",
"cashAvailableForTrade":8617.0200000000004,
"cashBalance":8617.0200000000004,
"category":"S",
"consolidatedSegTypes":["SEC","FUND"],
"currency":"USD",
"currencyAssets":
[
{
"cashAvailableForTrade":7714.4700000000003,
"cashBalance":7714.4700000000003,
"currency":"USD"
},
{
"cashAvailableForTrade":5800.29,
"cashBalance":5800.29,
"currency":"HKD"
},
{
"cashAvailableForTrade":1.5,
"cashBalance":1.5,
"currency":"NZD"
},
{
"cashAvailableForTrade":1123.95,
"cashBalance":1123.95,
"currency":"CNH"
},
{
"cashAvailableForTrade":0.12,
"cashBalance":0.12,
"currency":"EUR"
}
],
"equityWithLoan":8829.4200000000001,
"excessLiquidation":8617.0200000000004,
"grossPositionValue":212.40000000000001,
"initMargin":212.40000000000001,
"leverage":0.02,
"lockedFunds":0,
"maintainMargin":212.40000000000001,
"netLiquidation":8829.4200000000001,
"overnightLiquidation":8617.0200000000004,
"overnightMargin":212.40000000000001,
"realizedPL":0,
"totalTodayPL":0,
"uncollected":0,
"unrealizedPL":-29.760000000000002,
"unrealizedPLByCostOfCarry":-29.760000000000002
},
{"buyingPower":8617.0200000000004,"capability":"CASH","cashAvailableForTrade":8617.0200000000004,"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":8829.4200000000001,
"excessLiquidation":8617.0200000000004,"grossPositionValue":0,"initMargin":212.40000000000001,"leverage":0.02,"lockedFunds":0,
"maintainMargin":212.40000000000001,"netLiquidation":0,"overnightLiquidation":8617.0200000000004,"overnightMargin":212.40000000000001,
"realizedPL":0.78000000000000003,"totalTodayPL":0,"uncollected":0,"unrealizedPL":0,"unrealizedPLByCostOfCarry":0}],
"updateTimestamp":1741939073276
}
get_positions Get Positions
value get_positions(utility::string_t account = U(""), SecType sec_type = SecType::ALL, Currency currency = Currency::ALL,
Market market = Market::ALL,
utility::string_t symbol = U(""), const value &sub_accounts = value::array(), time_t expiry = -1,
utility::string_t strike = U(""), Right right = Right::ALL);
value get_positions(const utility::string_t &account, const utility::string_t &sec_type = U(""), const utility::string_t ¤cy = U("ALL"),
const utility::string_t &market = U("ALL"),
const utility::string_t &symbol = U(""), const value &sub_accounts = value::array(), time_t expiry = -1,
utility::string_t strike = U(""), const utility::string_t &right = U(""));
vector<Position> get_position_list(utility::string_t account = U(""), utility::string_t sec_type = U(""), utility::string_t currency = U("ALL"),
utility::string_t market = U("ALL"),
utility::string_t symbol = U(""), const value &sub_accounts = value::array(), time_t expiry = -1,
utility::string_t strike = U(""), utility::string_t right = U(""));
Description
Get the position information of the account
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
account | string_t | No | account id, if not specified, default account id configured in client_config will be used |
sec_type | SecType | No | SecType enumeration, including STK/OPT/FUT default: SecType::ALL. |
currency | Currency | No | Currency enumeration, including ALL/USD/HKD/CNH default: Currency::ALL |
market | Market | No | Market enumeration, including ALL/US/HK/CN default: Market::ALL |
symbol | string_t | No | Ticker symbol |
sub_accounts | list<str> | No | Sub account list |
expiry | time_t | No | Options expiration date default: -1 |
strike | float | No | Options strike price, example: 100.5 |
right | string_t | No | 'PUT' / 'CALL' for options default: Right::ALL |
Response
list
The structure is as follows:
Each element is a Position object.
Parameter | Type | Description |
---|---|---|
account | utility::string_t | Account id |
contract | Contract | Contract object |
position | long long | Position quantity |
average_cost | double | Holding cost |
latest_price | double | Latest price(During trading hours, it is the market price. For US stocks outside of trading hours, the prime account uses the after-hours closing price, while the global account uses the intraday closing price.) |
market_value | double | Market value |
realized_pnl | double | Realized profit and loss |
unrealized_pnl | double | Unrealized profit and loss |
Example
#include "tigerapi/trade_client.h"
#include "tigerapi/contract_util.h"
#include "tigerapi/order_util.h"
using namespace std;
using namespace web;
using namespace web::json;
using namespace TIGER_API;
/**
* Calling TradeClient
*/
class TestTradeClient {
public:
static void test_get_positions(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_positions();
cout << "position: " << res << endl;
}
static void test_trade(const std::shared_ptr<TradeClient>& trade_client) {
TestTradeClient::test_get_positions(trade_client);
}
};
int main(int argc, char *args[]) {
cout << "Tiger Api main" << endl;
/************************** set config **********************/
ClientConfig config = ClientConfig(true);
config.private_key = "-----BEGIN RSA PRIVATE KEY-----\n"
"xxxxxx private key xxxxxxxx"
"-----END RSA PRIVATE KEY-----";
config.tiger_id = "Tiger ID";
config.account = "Account ID";
/**
* Use TradeClient
*/
std::shared_ptr<TradeClient> trade_client = std::make_shared<TradeClient>(config);
TestTradeClient::test_trade(trade_client);
return 0;
}
Response
{
"account":"572386",
"averageCost":1.1932,
"averageCostByAverage":1.1932,
"averageCostOfCarry":1.1932,
"categories":[],
"comboTypeMap":{},
"contractId":7451,
"currency":"USD",
"identifier":"ROSGQ",
"lastClosePrice":0.0001,
"latestPrice":0.0001,
"market":"US",
"marketValue":0.00059999999999999995,
"multiplier":1,
"position":6,
"positionQty":6,
"positionScale":0,
"realizedPnl":0,
"realizedPnlByAverage":0,
"salableQty":6,
"secType":"STK",
"status":0,
"symbol":"ROSGQ",
"todayPnl":0,
"todayPnlPercent":0,
"unrealizedPnl":-7.1585000000000001,
"unrealizedPnlByAverage":-7.1585000000000001,
"unrealizedPnlByCostOfCarry":-7.1585000000000001,
"unrealizedPnlPercent":-0.99990000000000001,
"unrealizedPnlPercentByAverage":-0.99990000000000001,
"unrealizedPnlPercentByCostOfCarry":-0.99990000000000001,
"updateTimestamp":1741939624143
}
get_analytics_asset Get Analytics Asset
value get_analytics_asset(utility::string_t account, utility::string_t start_date, utility::string_t end_date, utility::string_t seg_type = U("SEC"), utility::string_t currency = U("USD"), utility::string_t sub_account = U(""));
Description
Get historical asset analysis of the account
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
account | utility::string_t | Yes | Account id |
start_date | utility::string_t | Yes | start date, format yyyy-MM-dd, like '2022-01-01' |
end_date | utility::string_t | Yes | end date, format yyyy-MM-dd, like '2022-02-01', if not passed, use current date |
seg_type | utility::string_t | no | Account segment default: U("SEC") |
currency | utility::string_t | no | currency type default: U("USD") |
sub_account | utility::string_t | no | Sub-account (for institutional accounts only), if this field is passed, the assets of the sub-account will be returned |
Return
summary: The corresponding value is the asset analysis summary.
Parameter | Type | Description |
---|---|---|
pnl | float | Profit and Loss Amount |
pnl_percentage | float | Profit and Loss Amount rate |
annualized_return | float | Annualized rate of return (imputed) |
over_user_percentage | float | Percentage of users exceeded |
history: History assets
Parameter | Type | Description |
---|---|---|
date | int | Date timestamp in milliseconds |
pnl | float | Amount of profit or loss compared to the previous day |
pnl_percentage | float | Yield compared to the previous day |
asset | float | Total assets amount |
cash_balance | float | Cash balance |
gross_position_value | float | position market value |
deposit | float | deposit amount |
withdrawal | float | withdrawal amount |
Examples
static void test_get_analytics_asset(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_analytics_asset(trade_client->client_config.account, U("2023-11-01"),
U("2023-12-31"));
ucout << U("analytics asset: ") << res << endl;
}
Return example
{
"history":
[
{
"asset":48831542.450000003,
"cashBalance":48831466.36999999997,
"date":1688356800000, "deposit":0,
"grossPositionValue": 76.0699999999999999993,
"pnl":0,
"pnlPercentage":0,
"withdrawal":0
},
{
"asset":48831533.82999999998,
"cashBalance":48831460.32,
"date": 1688443200000,
"deposit":0,
"grossPositionValue":73.510000000000005,
"pnl":-8.619999999999999992,
"pnlPercentage":0,
"withdrawal":0
},
{
" asset":48831521.65999999996,
"cashBalance":48831447.100000001,
"date":1688529600000,
"deposit":0,
"grossPositionValue": 74.5499999999999999997,
"pnl":-20.7899999999999999999,
"pnlPercentage":0,
"withdrawal":0
},
{
"asset":48831519.65999999996,
"cashBalance":48831446
},
{
"asset":48831525.450000003,
"cashBalance":48831454.530000001,
"date":1688702400000,
"deposit":0,
"grossPositionValue": 70.920000000000002,
"pnl":-17,
"pnlPercentage":0,
"withdrawal":0
}
],
"summary":
{
"annualizedReturn":0,
"overUserPercentage":0,
"pnl":-8.8900000000000006,
"pnlPercentage":0
}
}
get_estimate_tradable_quantity
value get_estimate_tradable_quantity(Order &order, utility::string_t seg_type = U("SEC"))
Description
Query the maximum buy/sell quantity for a specific asset under the account, supporting stocks and options, but not futures.
Parameters
Fields | Type | Description |
---|---|---|
order | Order | Order to be queried |
seg_type | utility::string_t | Segment type default: U("SEC") |
Only limit or stop orders are supported; futures are not supported for the time being.
Returns
Fields | Type | Description |
---|---|---|
position_quantity | float | Position (held) quantity |
tradable_position_quantity | float | Quantity available for trading |
tradable_quantity | float | Cash Tradable Quantity (If action is 'buy', returns the quantity available for purchase; otherwise, returns the quantity available for sale) |
example
static void test_get_estimate_tradable_quantity(const std::shared_ptr<TradeClient>& trade_client) {
Contract contract = ContractUtil::stock_contract(U("AAPL"), U("USD"));
Order order = OrderUtil::limit_order(contract, U("BUY"), 1, 100.0); value res = trade_client-contract(U("AAPL"), U("USD")); value
value res = trade_client->get_estimate_tradable_quantity(order);
ucout << U("estimate tradable quantity: ") << res << endl;
}
Return example
{
"positionQuantity":0,
"tradablePositionQuantity":0,
"tradableQuantity":77}
get_segment_fund_available
value get_segment_fund_available(utility::string_t from_segment, utility::string_t currency = U("USD"))
Description
Get the funds available for transfer under the corresponding segment of the account (consolidated/demo account).
Parameters
Parameters | Type | Required | Description |
---|---|---|---|
from_segment | utility::string_t | Yes | Transfer out segment, FUT or SEC |
currency | utility::string_t | No | Transfer out currency default: U("USD") |
Returns
Name | Type | Description |
---|---|---|
from_segment | string | Transfer out segment, FUT or SEC |
currency | string | Transfer out currency, USD or HKD |
amount | float | Transferable funds, in dollars |
Examples
static void test_get_segment_fund_available(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_segment_fund_available(U("SEC"));
ucout << U("segment fund available: ") << res << endl;
}
Return example
[{"amount":93104.7599999999999995, "currency": "USD", "fromSegment": "SEC"}]
transfer_segment_fund
value transfer_segment_fund(utility::string_t from_segment, utility::string_t to_segment, double amount, utility::string_t currency = U("USD"))
Description
Transfer of funds under different segments of an account, e.g. securities segment to futures segment (for consolidated or demo accounts).
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
from_segment | utility::string_t | Yes | transfer out segment, FUT or SEC |
to_segment | utility::string_t | Yes | transfer to segment, FUT or SEC, must be different from from_segment |
amount | double | Yes | Transfer amount in $ of corresponding currency |
currency | utility::string_t | No | Transfer to segment default: U("USD") |
Returns
name | type | description |
---|---|---|
id | int | Transfer Record ID |
from_segment | utility::string_t | transfer_segment, FUT or SEC |
to_segment | utility::string_t | Transfer in to segment, FUT or SEC |
currency | utility::string_t | transfer_out_currency, USD or HKD |
amount | float | Transfer amount in dollars |
status | utility::string_t | Status (NEW/PROC/SUCC/FAIL/CANC) |
status_desc | utility::string_t | status_description (submitted/processing/accounted/failed/canceled) |
message | utility::string_t | Failed message |
settled_at | int | Arrival timestamp |
updated_at | int | update_timestamp |
created_at | int | Creation timestamp |
Example
static void test_transfer_segment_fund(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->transfer_segment_fund(U("SEC"), U("FUT"), 10.0);
ucout << U("transfer segment fund: ") << res << endl;
}
Return example
{'id': 30322815980011520, 'from_segment': 'SEC', 'to_segment': 'FUT', 'currency': 'USD',
'amount': 100.0, 'status': 'NEW', 'status_desc': 'Submitted', 'message': None, 'settled_at': None,
'updated_at': 1680243926131, 'created_at': 1680243926131}
get_segment_fund_history
value get_segment_fund_history(int limit = 0);
Description
Query historical transfer records between account segments, sorted in descending order by time. (Applicable to comprehensive/simulated accounts)
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
limit | int | No | Returns the most recent transfer records. Default is 100, maximum is 500. |
Response
Field | Type | Description |
---|---|---|
id | int | Transfer record ID |
from_segment | utility::string_t | Outgoing segment, FUT or SEC. |
to_segment | utility::string_t | Incoming segment, FUT or SEC |
currency | utility::string_t | Outgoing currency, USD or HKD |
amount | float | Transfer amount |
status | utility::string_t | Status (NEW/PROC/SUCC/FAIL/CANC) |
status_desc | utility::string_t | Status description (Submitted/Processing/Transferred/Transfer Failed/Cancelled) |
settled_at | int | Timestamp of when transfer was settled |
updated_at | int | Timestamp of when transfer was updated |
created_at | int | Timestamp of when transfer was created |
Example
static void test_get_segment_fund_history(const std::shared_ptr<TradeClient>& trade_client) {
value res = trade_client->get_segment_fund_history();
ucout << U("segment fund history: ") << res << endl;
}
Response Example
[
{
"amount":10,
"createdAt":1689250798000,
"currency":"USD",
"fromSegment":"SEC",
"id":31503365023203328,
"settledAt":1689250802000,
"status":"SUCC",
"statusDesc":"SUCCESS",
"toSegment":"FUT",
"updatedAt":1689250798000
}
]