Skip to main content
This page describes the local package. The pages under the Data sections describe the tqx_data environment available in Qube. Check the package’s installed tqx_data.md for field-level details and version-specific changes.

Initialize

You can set TQX_API_KEY and TQX_API_BASE_URL instead, then call tqx_data.init(). Do not put an API key in source code or repositories.

Documented methods

All tabular methods return a pandas.DataFrame. The returned columns are the fields requested through fields, together with the identifying columns that the method requires. Read the installed tqx_data.md for the complete field list of each method. For combined methods, use market="hk" for Hong Kong and market="us" for US data, including get_financial_statement. Some methods also accept nb for compatibility; use us in new code. Dates use YYYYMMDD; financial quarters use YYYYqN.

TickStreamClient

TickStreamClient delivers real-time Tick messages over WebSocket. The constructor requires market="HK" or market="US"; use .HK symbols for Hong Kong and bare symbols such as AAPL for US stocks.
The public controls are subscribe_tick, unsubscribe_tick, listen, close, subscribed_symbols, is_running, and get_stats.