Expand description
Quant1X Standard Library for Rust
This library provides cross-language compatible utilities for quantitative trading, with implementations in C++, Go, and Rust that maintain API consistency.
§命名空间设计
- Crate名称:
quant1x - 命名空间:
quant1x:: - 使用方式:
use quant1x::Timestamp;
§示例
use quant1x::Timestamp;
let ts = Timestamp::now();
let parsed = Timestamp::parse("2022-06-15 14:30:45").unwrap();Modules§
Structs§
- Binary
Stream - Calendar
Decoder - Connection
- A pooled connection wrapper. The pool owns connections and returns a guard that will return the connection to the pool when dropped.
- Endpoint
- Endpoint
Manager - Simple thread-safe endpoint manager, similar to the C++ EndpointManager.
- FPGrowth
Miner - FP-Growth 挖掘器
- Heartbeat
Request - Heartbeat
Response - Hello1
Request - Hello1
Response - Hello2
Request - Hello2
Response - Pooled
Connection - RAII guard that returns the connection to the pool when dropped.
- Protocol
Handler - Minimal client-side protocol helper mirroring C++ ProtocolHandler handshake and keepalive.
- Record
- Rolling
Once - RollingOnce provides C++-equivalent semantics:
- Runtime
Status - TcpConnection
Pool - The Mio-based TCP connection pool. This is a simplified port of the C++ TcpConnectionPool semantics: acquire returns a connection which is automatically returned on Drop.
- Time
Range - Timestamp
- 本地时间戳,单位毫秒
- Trading
Session - Xdxr
Info - Xdxr
Info Request - Xdxr
Info Response
Constants§
- MASK_
ACTIVE - MASK_
CALL_ AUCTION - MASK_
CANCELABLE - MASK_
CLOSED - MASK_
CLOSING - MASK_
HALT - MASK_
OPENING - MASK_
ORDER - MASK_
TRADING - MILLISECONDS_
PER_ DAY - MILLISECONDS_
PER_ HOUR - MILLISECONDS_
PER_ MINUTE - MILLISECONDS_
PER_ SECOND - PRE_
MARKET_ HOUR - PRE_
MARKET_ MINUTE - PRE_
MARKET_ SECOND - SECONDS_
PER_ DAY - SECONDS_
PER_ HOUR - SECONDS_
PER_ MINUTE
Traits§
- Network
Handler - Trait that the user of the connection pool should implement to perform protocol-specific work: handshake and keepalive checks.
Functions§
- add
- assert_
index_ by_ market_ and_ code - AssertIndexByMarketAndCode equivalent from C++ exchange::code.cpp
- can_
initialize - can_
update_ in_ realtime - check_
trading_ timestamp - client
- Acquire a pooled connection to a level1 server.
- date_
range - default_
base_ unit - defaultBaseUnit equivalent from C++ security_quote.h
- get_
calendar_ filename - Return the filename used for the calendar cache (convenience wrapper around
the internal config helper). This is intentionally a tiny, stable API so
external tests and tools can locate the calendar cache without exposing the
full
configmodule. - get_
calendar_ list - get_
datetime_ from_ u32 - get_
market_ flag - homedir
- Return the preferred home directory following C++ priority: QUANT1X_HOME, GOX_HOME, HOME (or USERPROFILE on Windows), then fallback to temp dir.
- int_
to_ float64 - is_
trading_ disabled - last_
trading_ day - next_
trading_ day - prev_
trading_ day - process_
request - Send a request buffer on a blocking
mio::net::TcpStream, read the level1 response header and body, and return the (possibly decompressed) body bytes. This mirrors the C++level1::process()unzip semantics. - security_
code - Build a security code string like C++
exchange::GetMarketFlag(...) + code - sequence_
id - unzip
- 解压 zlib 压缩的数据