Object Descriptions

PortfolioAccount Assets (Standard/Paper Account)

Description

Account asset object for standard/paper accounts. Contains information about the account's total assets, P&L, position market value, cash, available funds, margin, leverage, etc.

In the C++ SDK, account asset interfaces return web::json::value JSON objects, with field names corresponding to the property names in the table below.

Object Properties

PropertyTypeDescription
accountstringCorresponding account ID
update_timestampint64Update time, 13-digit millisecond timestamp
segmentsobjectAccount information categorized by trading product. A JSON object with two keys: S for securities and C for futures, values are Segment objects

Segment Assets by Product (Standard/Paper Account)

Description

Assets divided by securities/futures trading products, each part is a Segment.

Object Properties

PropertyTypeDescription
currencystringCurrency, e.g., USD, HKD
capabilitystringAccount type. Margin account: RegTMargin, Cash account: Cash. Margin accounts support margin trading, unlimited day trades, max buying power of 4x intraday and 2x overnight.
categorystringTrading product category. C: Commodities (Futures), S: Securities (Stocks), F: Funds
cash_balancedoubleCash balance. The sum of all currency cash balances.
cash_available_for_tradedoubleAvailable funds. Used to check whether new positions or IPO subscriptions can be made.
cash_available_for_withdrawaldoubleCash amount available for withdrawal
buying_powerdoubleMaximum buying power. Margin accounts have up to 4x buying power intraday and 2x overnight.
gross_position_valuedoubleTotal securities value, the sum of market values of all securities positions.
equity_with_loandoubleEquity with loan value (ELV), used to calculate opening and closing data metrics.
net_liquidationdoubleNet liquidation value (total assets). Net liquidation = total securities market value + cash balance + accrued dividends - accrued interest.
init_margindoubleInitial margin. Sum of initial margin requirements for all current positions.
maintain_margindoubleMaintenance margin. Sum of maintenance margin requirements for all current positions.
overnight_margindoubleOvernight margin. Margin checked starting 15 minutes before market close.
unrealized_pldoubleUnrealized P&L. Current price * shares - position cost.
realized_pldoubleRealized P&L. Total realized P&L from closed positions in the current holding cycle.
excess_liquidationdoubleExcess liquidity. excess_liquidation = equity_with_loan - maintain_margin.
overnight_liquidationdoubleOvernight excess liquidity. equity_with_loan - overnight_margin.
leveragedoubleLeverage. leverage = sum of absolute securities market values / net liquidation.
currency_assetsobjectAccount asset information by currency, a JSON object keyed by currency, values are CurrencyAsset objects
uncollecteddoubleFunds in transit
locked_fundsdoubleLocked funds

CurrencyAsset Assets by Currency (Standard/Paper Account)

Description

Assets categorized by currency.

Object Properties

PropertyTypeDescription
currencystringCurrent currency type. Common currencies: USD (US Dollar), HKD (Hong Kong Dollar), SGD (Singapore Dollar), CNH (Chinese Yuan)
cash_balancedoubleTradable cash plus locked cash
cash_available_for_tradedoubleCash amount available for trading
forex_ratedoubleExchange rate of current currency against base_currency

PortfolioAccount Assets (Global Account)

Description

Account asset object for global accounts. Contains information about the account's total assets, P&L, position market value, cash, available funds, margin, leverage, etc.

Object Properties

PropertyTypeDescription
accountstringCorresponding account ID
summaryobjectAccount summary information, aggregated from segments, as an Account object
segmentsobjectAccount information categorized by trading product. Two keys: S for securities, C for futures

Account Summary Assets (Global Account)

Description

Summarized asset information across all trading products.

Object Properties

PropertyTypeDescription
accrued_cashdoubleAccumulated accrued interest for the current month, updated daily
accrued_dividenddoubleAccumulated dividends. Sum of all executed but unpaid dividends
available_fundsdoubleAvailable funds (for trading). Calculated as equity_with_loan - initial_margin_requirement
buying_powerdoubleBuying power: estimated amount of stock assets you can still purchase. Margin accounts have up to 4x buying power intraday and 2x overnight
cashdoubleCash amount
currencystringCurrency
cushiondoubleRatio of excess liquidity to net liquidation. Calculated as: excess_liquidity / net_liquidation
day_trades_remainingintRemaining day trades for today, -1 means unlimited
equity_with_loandoubleEquity with loan value. Securities Segment: cash value + stock value. Futures Segment: cash value - maintenance margin
excess_liquiditydoubleExcess liquidity
gross_position_valuedoubleTotal securities value: long stock value + short stock value + long option value + short option value
initial_margin_requirementdoubleInitial margin requirement
maintenance_margin_requirementdoubleMaintenance margin requirement
realized_pnldoubleToday's realized P&L
unrealized_pnldoubleUnrealized P&L
net_liquidationdoubleNet liquidation value (total assets). Securities Segment: cash value + stock value + stock option value. Futures Segment: cash value + mark-to-market P&L
regt_equitydoubleSecurities Segment only. Equity with loan calculated per Regulation T
regt_margindoubleSecurities Segment only. Initial margin requirements calculated per Regulation T
smadoubleSecurities Segment only. Overnight risk control value
timestampint64Update time

SecuritySegment Securities Assets (Global Account)

Description

Securities asset information.

Object Properties

PropertyTypeDescription
accrued_cashdoubleAccumulated accrued interest for the current month, updated daily
accrued_dividenddoubleAccumulated dividends. Sum of all executed but unpaid dividends
available_fundsdoubleAvailable funds (for trading). Calculated as equity_with_loan - initial_margin_requirement
cashdoubleCash
equity_with_loandoubleEquity with loan value. Calculated as: cash value + stock value
excess_liquiditydoubleExcess liquidity. Calculated as: equity_with_loan - maintenance_margin_requirement
gross_position_valuedoubleTotal securities value: long stock value + short stock value + long option value + short option value
initial_margin_requirementdoubleInitial margin requirement
maintenance_margin_requirementdoubleMaintenance margin requirement
leveragedoublegross_position_value / net_liquidation
net_liquidationdoubleNet liquidation value (total assets). Calculated as: cash value + stock value + stock option value
regt_equitydoubleEquity with loan calculated per Regulation T
regt_margindoubleInitial margin requirements calculated per Regulation T
smadoubleOvernight risk control value
timestampint64Update time

CommoditySegment Futures Assets (Global Account)

Description

Futures asset information.

Object Properties

PropertyTypeDescription
accrued_cashdoubleAccumulated accrued interest for the current month, updated daily
accrued_dividenddoubleAccumulated dividends. Sum of all executed but unpaid dividends
available_fundsdoubleAvailable funds (for trading). Calculated as equity_with_loan - initial_margin_requirement
cashdoubleCash
equity_with_loandoubleEquity with loan value. Calculated as: cash value - maintenance margin
excess_liquiditydoubleExcess liquidity. Calculated as: net_liquidation - maintenance_margin_requirement
initial_margin_requirementdoubleInitial margin requirement
maintenance_margin_requirementdoubleMaintenance margin requirement
net_liquidationdoubleNet liquidation value (total assets). Calculated as: cash value + mark-to-market P&L
timestampint64Update time

MarketValue Assets by Currency (Global Account)

Description

Asset information categorized by currency.

Object Properties

PropertyTypeDescription
currencystringCurrency unit
net_liquidationdoubleNet liquidation value (total assets)
cash_balancedoubleCash
stock_market_valuedoubleStock market value
option_market_valuedoubleOption market value
warrant_valuedoubleWarrant market value
futures_pnldoubleMark-to-market P&L
unrealized_pnldoubleUnrealized P&L
realized_pnldoubleRealized P&L
exchange_ratedoubleExchange rate against account base currency
net_dividenddoubleNet value of dividends payable and receivable
timestampint64Update time

Position

Description

Account position information. Includes the position's contract details, quantity, cost, P&L, etc. In the C++ SDK, Position is defined in tigerapi/model.h.

Object Properties

PropertyTypeDescription
accountstringCorresponding account ID
contractContractContract object
position_qtydoublePosition quantity
quantityintPosition quantity (deprecated), use with position_scale when fractional positions exist
position_scaleintPosition quantity decimal offset (deprecated)
average_costdoubleAverage cost including commission
market_valuedoubleMarket value
salable_qtydoubleSellable quantity
average_cost_of_carrydoubleAccumulated position cost (A-share calculation method)
market_pricedoubleMarket price
realized_pnldoubleRealized P&L under FIFO method
unrealized_pnldoubleUnrealized P&L
unrealized_pnl_by_cost_of_carrydoubleUnrealized P&L (A-share calculation method)
unrealized_pnl_percent_by_cost_of_carrydoubleUnrealized P&L percentage (A-share calculation method)
today_pnldoubleToday's P&L amount
today_pnl_percentdoubleToday's P&L percentage
last_close_pricedoubleLast intraday close price (forward adjusted). For US stocks during trading hours, this is the previous trading day's close price

Order

Description

Order object. Returned when querying orders. In the C++ SDK, Order is defined in tigerapi/model.h.

Object Properties

PropertyTypeDescription
accountstringAccount the order belongs to
idint64Global order ID
order_idintAuto-increment order number (deprecated)
parent_idint64Parent order ID, currently only used for attached orders in TigerTrade App
order_timeint64Order placement time, 13-digit millisecond timestamp
trade_timeint64Order status update time. For filled orders, this is the fill time; for cancelled orders, this is the cancellation time
update_timeint64Order update time, updated when order properties change (e.g., price modification)
expire_timeint64GTD order expiry time, 13-digit millisecond timestamp
reasonstringFailure reason description when order placement fails
actionstringTrade direction, BUY / SELL
quantityintOrder quantity
quantity_scaleintOrder quantity offset, default 0. For fractional share orders, quantity and quantity_scale together represent the actual order quantity
total_cash_amountdoubleTotal order amount, empty when ordering by shares
filled_cash_amountdoubleFilled amount
refund_cash_amountdoubleRefund amount, equals total order amount - filled amount
filledintFilled quantity
avg_fill_pricedoubleAverage fill price excluding commission
commissiondoubleIncludes commission, stamp duty, regulatory fees, etc.
realized_pnldoubleRealized P&L
trail_stop_pricedoubleTrailing stop price
limit_pricedoubleLimit order price
aux_pricedoubleIn stop orders, the trigger price; in trailing stop orders, the trailing price difference
trailing_percentdoubleTrailing stop percentage, range 0-100
order_typestringOrder type: MKT Market / LMT Limit / STP Stop / STP_LMT Stop Limit / TRAIL Trailing Stop
time_in_forcestringTime in force: DAY Day / GTC Good-Til-Cancelled / GTD Good-Til-Date (requires expire_time)
outside_rthboolWhether pre/post-market trading is supported, US stocks only
trading_session_typestringOvernight trading session
contractContractContract object

Transaction

Description

Order transaction records.

Object Properties

PropertyTypeDescription
accountstringAccount
order_idint64Order ID
contractContractContract object
idint64Transaction record ID
actionstringOrder direction
filled_quantityintFilled quantity
filled_quantity_scaleintFilled quantity offset
filled_pricedoubleFill price
filled_amountdoubleFill amount
transacted_atstringTransaction time

OrderLeg Attached Order

Description

Attached orders carried alongside a main order. In the C++ SDK, OrderLeg is defined in tigerapi/model.h.

Object Properties

PropertyTypeDescription
leg_typestringAttached order type. PROFIT take-profit type, LOSS stop-loss type
pricedoubleAttached order price
time_in_forcestringAttached order time in force. DAY (day valid) and GTC (Good-Til-Canceled)
outside_rthboolWhether attached order allows pre/post-market trading (US stocks only). true = allowed, false = not allowed

Contract

Description

A contract refers to the trading target or underlying asset (such as a stock or an option). Contracts are standardized by exchanges, and contract information can uniquely identify an underlying asset when placing orders or fetching quotes. In the C++ SDK, Contract is defined in tigerapi/model.h.

Common contract types include stock contracts, option contracts, futures contracts, etc., with the following elements:

  • Symbol (symbol): US stocks, UK stocks, etc. use alphabetic codes; HK stocks, A-shares, etc. use numeric codes
  • Security Type (sec_type): Common types include STK (Stock), OPT (Option), FUT (Futures), CASH (Forex)
  • Currency (currency): Common currencies include USD (US Dollar), HKD (Hong Kong Dollar)
  • Exchange (exchange): Generally not needed for STK type; required for futures contracts

Construction Examples

#include "tigerapi/trade_client.h"
using namespace TIGER_API;

// Stock contract
Contract contract = ContractUtil::stock_contract(U("AAPL"), U("USD"));

// Option contract
Contract opt = ContractUtil::option_contract(U("AAPL"), U("20231215"), U("CALL"), 190.0, U("USD"));

// Futures contract
Contract fut = ContractUtil::future_contract(U("CL"), U("USD"), U("20231220"));

Object Properties

PropertyTypeDescription
identifierstringUnique identifier. For stocks, identifier equals symbol; for options, it is a 21-character OCC identifier, e.g., AAPL 220729C00150000
symbolstringStock code. For option contracts, symbol is the underlying asset code
sec_typestringSTK Stock / OPT Option / FUT Futures / WAR Warrant / IOPT CBBC, etc. Default STK
namestringContract name
currencystringCurrency: USD/HKD/CNH
exchangestringExchange
expirystringOptions and Futures only. Expiration date
strikedoubleOptions only. Strike price
multiplierdoubleContract multiplier (shares per lot)
put_callstringOptions only. Option direction: CALL or PUT
local_symbolstringGlobal accounts only. Used to identify warrants and CBBCs for HK stocks
short_initial_margindoubleShort initial margin ratio
short_maintenance_margindoubleShort maintenance margin ratio
short_fee_ratedoubleShort fee rate
shortableintShort pool remaining
long_initial_margindoubleLong initial margin
long_maintenance_margindoubleLong maintenance margin
contract_monthstringContract month, e.g., 202201 for January 2022
primary_exchangestringPrimary exchange where the stock is listed
marketstringMarket: US/HK/CN
min_tickdoubleMinimum tick size
continuousboolFutures only. Whether it is a continuous contract
trading_classstringTrading class name of the contract
statusstringContract status: 0 = not tradable, 1 = tradable
tradeboolFutures only. Whether tradable
last_trading_datestringFutures only. Last trading date, e.g., 20211220
first_notice_datestringFutures only. First notice date. Long positions cannot be opened after this date
last_bidding_close_timeint64Futures only. Bidding close timestamp
is_etfboolWhether it is an ETF
etf_leverageintETF leverage multiplier, only present for ETF contracts
lot_sizedoubleMinimum tradable quantity per transaction
support_overnight_tradingboolWhether overnight trading is supported

MarketStatus

Description

Market trading status. In the C++ SDK, MarketStatus is defined in tigerapi/model.h.

Object Properties

PropertyTypeDescription
marketstringMarket (US: US stocks, CN: China A-shares, HK: Hong Kong stocks)
trading_statusstringMarket trading status code: NOT_YET_OPEN; PRE_HOUR_TRADING; TRADING; MIDDLE_CLOSE; POST_HOUR_TRADING; CLOSING; OVERNIGHT_TRADING; EARLY_CLOSED; MARKET_CLOSED
statusstringMarket status description (Not Yet Open, Trading, Closed, etc.)
open_timestringMost recent opening time

OptionFilter Option Chain Filter

Description

Option filter parameter object. In the C++ SDK, OptionFilter is defined in tigerapi/model.h.

Object Properties

ParameterTypeRequiredDescription
implied_volatilitydoubleNoImplied volatility. Reflects market expectations of future stock price volatility. Higher IV indicates greater expected price movement
in_the_moneyboolNoWhether in-the-money
open_interestintNoOpen interest. Number of outstanding contracts at end of each trading day. Reflects market depth and liquidity
deltadoubleNoDelta. Reflects the impact of stock price changes on option price. For every $1 change in stock price, option price changes by approximately delta. Range: -1.0 to 1.0
gammadoubleNoGamma. Reflects the impact of stock price changes on delta. For every $1 change in stock price, delta changes by gamma
thetadoubleNoTheta. Reflects the impact of time decay on option price. For each day that passes, option price changes by approximately theta
vegadoubleNoVega. Reflects the impact of volatility changes on option price. For every 1% change in volatility, option price changes by approximately vega
rhodoubleNoRho. Reflects the impact of risk-free rate changes on option price. For every 1% change in risk-free rate, option price changes by approximately rho

Order Changes

Fields received in order push callbacks:

FieldDescription
idOrder ID
accountFund account
symbolPosition symbol code, e.g., AAPL, 00700, ES, CN
expiryOptions, warrants, and CBBCs only
strikeOptions, warrants, and CBBCs only
rightOptions, warrants, and CBBCs only
identifierUnderlying identifier. For stocks, identifier equals symbol. For futures, includes contract month, e.g., CN2201
multiplierContract multiplier, for futures, options, warrants, and CBBCs only
actionTrade direction. BUY for buy, SELL for sell
marketMarket: US, HK
currencyCurrency: USD (US Dollar), HKD (Hong Kong Dollar)
segTypeCategory by trading product. S for securities, C for futures
secTypeSTK Stocks, OPT Options, WAR Warrants, IOPT CBBC, CASH Forex, FUT Futures, FOP Futures Options
orderTypeOrder type: MKT Market / LMT Limit / STP Stop / STP_LMT Stop Limit / TRAIL Trailing Stop
isLongWhether long position
totalQuantityOrder quantity
totalQuantityScaleOrder quantity offset
filledQuantityTotal filled quantity (for orders with multiple partial fills, filledQuantity is the cumulative total)
filledQuantityScaleFilled quantity offset
avgFillPriceAverage fill price
limitPriceLimit order price
stopPriceStop price
realizedPnlRealized P&L (only available for standard accounts)
statusOrder status
outsideRthWhether pre/post-market trading is allowed, US stocks only
canModifyWhether the order can be modified
canCancelWhether the order can be cancelled
nameUnderlying name
sourceOrder source
errorMsgError message
openTimeOrder placement time
timestampLast order status update time

Position Changes

Fields received in position push callbacks:

FieldDescription
accountUser account
symbolStock code
expiryExpiration date. Options, warrants, and CBBCs only
strikeStrike price. Options, warrants, and CBBCs only
rightOption direction PUT/CALL. Options, warrants, and CBBCs only
identifierUnderlying identifier
multiplierContract multiplier. Options, warrants, and CBBCs only
marketTrading market
currencyCurrency type
segTypeCategory by trading product. S for securities, C for futures
secTypeSecurity type
positionPosition
positionScalePosition quantity offset
averageCostAverage cost
latestPriceLatest price
marketValueMarket value
unrealizedPnlUnrealized P&L
nameUnderlying name
timestampServer time

Asset Changes

Fields received in asset push callbacks:

FieldDescription
accountUser account
currencyCurrency type
segTypeCategory by trading product. S for securities, C for futures
availableFundsAvailable funds (equity with loan - initial margin)
excessLiquidityExcess liquidity (equity with loan - maintenance margin)
netLiquidationNet liquidation value
equityWithLoanEquity with loan value
buyingPowerBuying power
cashBalanceAccount cash balance
grossPositionValuePosition market value
initMarginReqCurrent initial margin requirement
maintMarginReqCurrent maintenance margin requirement
timestampServer time

Quote Changes

  • Basic Quote
FieldSub-fieldDescription
symbolStock code
typeType
timestampQuote data time
serverTimestampServer time
avgPriceAverage price
latestPriceLatest price
latestPriceTimestampLatest price timestamp (not available in pre/post market)
latestTimeLatest price time
preClosePrevious close price
volumeCumulative volume for the day
amountCumulative turnover for the day (not supported for options/futures)
openOpen price
highHigh price
lowLow price
hourTradingTagPre/post-market indicator (no value during US regular hours). Values: PreMarket/AfterHours
marketStatusMarket status
identifierUnderlying identifier (options only)
openIntOpen interest (options only)
tradeTimeTrade time (futures only)
preSettlementPrevious settlement price (futures only)
minTickMinimum tick size (futures only)
mipMinute price
miaMinute average price
mitMinute time
mivMinute volume
mioMinute open price (futures only)
mihMinute high price (futures only)
milMinute low price (futures only)
  • Best Bid/Ask Quote
FieldDescription
askPriceAsk price
askSizeAsk size
askTimestampAsk timestamp (Pre/Post-Mkt data not supported)
bidPriceBid price
bidSizeBid size
bidTimestampBid timestamp (Pre/Post-Mkt data not supported)