.HK, for example 0700.HK. US symbol formats depend on the interface: some Qube methods use a .NB suffix, for example AAPL.NB, while the local package’s documented examples use AAPL.
Install tqx_data
Download thetqx-data package from PyPI:
tqx-data requires Python 3.10 or later. Follow the
tqx_data.md shipped inside the installed package for its exact dependency
constraints.
The local data package uses an API key with data access permission. It is
separate from the Qube research client and trading APIs. Contact Audrey at
audrey@tqx.ai to request data access.
Initialize with an API key
Pass the key and service base URL before calling a data method:TQX_API_KEY and TQX_API_BASE_URL, then call
tqx_data.init(). The explicit api_key takes precedence over the
environment variable. Never put the key in source files or repositories.
Use tqx-data with a coding agent
Copy the following prompt into your coding agent:Qube and the PyPI package
The methods on these pages follow thetqx_data built into Qube. The local
API-Key package differs in these ways:
- Pages and methods marked Qube only are not in the local package: minute bars, live minute bars, latest tick snapshots, indicator calculation, factors, and index components.
-
The local package documents these methods:
get_hk_daily,get_us_daily,get_stock_detail,get_trading_calendar,get_currency,get_event_devidend,get_event_capital_market,get_event_corporate_actions,get_event_fina_disclosure,get_event_investor_relation_activities,get_company_concentration,get_company_top_concentration,get_company_investor,get_company_insider_transaction,get_company_shareholder_report,get_company_price_vol,get_company_oper_metrics,get_company_current,get_company_imed,get_consensus_nonperiod,get_consensus_recommend, andget_financial_statement. -
The local package also documents
TickStreamClientfor real-time tick delivery. Itstqx_data.mdfile is the allowlist for supported method names, parameters, and fields. -
Source files may contain readers that are not in
tqx_data.md; those readers are not documented or supported for users.
Use the data in backtests
- Daily bars aren’t adjusted for dividends or splits, and
alt_closeequalsclose. To build an adjusted or total-return series, apply the events fromget_event_devidend. - Data marked Latest data only has no history. Don’t use it for historical signals in a backtest, because it would leak later information into earlier dates.
- Use an event only from its announcement date onward.

