Expand description
Shared trade market projection helpers.
These are pure helpers used by gateway response projection and CLI/domain adapters. Keep them here instead of in one surface handler so market prefix and futures-ticker fallback rules have a single callable source.
Structs§
- Cached
Account Market - Market namespace read from
CachedTrdAcc.trd_market. - RawAccount
Market - Backend raw
Account.marketvalue cached inCachedTrdAcc.trd_market.
Constants§
- TRD_
MARKET_ INT_ VALUES - Official OpenAPI
Trd_Common.TrdMarketinteger values accepted by read surfaces, including view-only fund markets. - TRD_
MARKET_ NON_ FUND_ INT_ VALUES - Official OpenAPI
Trd_Common.TrdMarketinteger values accepted by active write/calculation surfaces. Fund markets stay read-only. - TRD_
MARKET_ NON_ FUND_ PARSE_ CHOICES - TRD_
MARKET_ NON_ FUND_ STRING_ VALUES - User-facing aliases accepted for active write/calculation paths.
- TRD_
MARKET_ PARSE_ CHOICES - TRD_
MARKET_ STRING_ VALUES - User-facing aliases accepted for
Trd_Common.TrdMarketread paths.
Functions§
- canonical_
fund_ trd_ market_ label - Label for canonical OpenAPI fund markets only.
- derive_
sec_ market - Derive FTAPI
TrdSecMarketfrom explicit value, account market, and code. - derive_
trd_ sec_ market - Derive FTAPI
TrdSecMarketfrom explicit value, account market, and code. - extract_
futures_ ticker_ prefix - Extract the ticker prefix from a futures code.
- futures_
ticker_ to_ sec_ market - Legacy raw-value facade for futures ticker fallback.
- futures_
ticker_ to_ trd_ sec_ market - Derive
TrdSecMarketfrom known futures ticker prefixes. - is_
futures_ code - Return whether the code looks like a futures symbol.
- parse_
non_ fund_ trd_ market - Parse a trade market for active write/calculation paths.
- parse_
trd_ market - Parse a user-facing trade market string into the canonical OpenAPI
Trd_Common.TrdMarketenum. - sec_
market_ from_ code_ prefix - Derive
TrdSecMarketfrom an explicit code prefix such asHK./US.. - sec_
market_ from_ code_ prefix_ typed - Typed variant of
sec_market_from_code_prefix. - strip_
market_ prefix - Strip a known FTAPI market prefix from a user/security code.
- trd_
market_ from_ i32 - Convert official OpenAPI
Trd_Common.TrdMarketinteger values into the canonical project enum. - trd_
market_ label - Canonical
Trd_Common.TrdMarketlabel used by user-facing filters and surface adapters. - view_
only_ fund_ market_ label - Label for fund markets that are view-only on active write/calculation paths.