CLI tool for retrieving and structuring K-line data for China A-shares, Hong Kong stocks, and US stocks.
- Fetches
daily,weekly, andmonthlycandles - Supports
cn,hk, andussymbols - Computes
EMA20, slope, distance, gap flags, and candlestick classifications - Outputs JSON suitable for agent workflows
Default source routing:
cn:ths -> tencent -> eastmoneyhk:tencent -> eastmoneyus:tencent -> eastmoney
Requires uv.
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | shuvx --from ./assets pa kline <CODE> [OPTIONS]
uvx --from ./assets pa info <CODE> [OPTIONS]Common examples:
uvx --from ./assets pa kline 600000
uvx --from ./assets pa kline 000895 --market-type cn
uvx --from ./assets pa kline 01919 --market-type hk
uvx --from ./assets pa kline AAPL --market-type us
uvx --from ./assets pa kline 601919 -p weekly
uvx --from ./assets pa kline MSFT --market-type us --source tencent
uvx --from ./assets pa info AAPL --market-type us| Option | Description |
|---|---|
CODE |
Symbol, supports sh / sz / bj / hk / us prefixes |
--count, -n |
Candle count, 20-250, default 60 |
--period, -p |
daily / weekly / monthly |
--market-type |
auto / cn / hk / us |
--source |
auto / ths / tencent / eastmoney |
--market, -m |
Manual THS market id override for cn + ths |
--compact, -c |
Compact JSON output |
Top-level fields:
codenamemarketsourceperiodcountklines
Per-bar fields:
date,open,high,low,closevolume,amount,turnoverchange_pct,amplitudeema20,ema20_slope,ema20_distancebody_ratio,upper_wick_ratio,lower_wick_ratio,close_positionbar_typegapwhen presentlimitfor China A-shares when present
600000,000895-> China A-share700,00700,01919-> Hong Kong stockAAPL,MSFT-> US stock- Prefixed forms also work:
sh600000,hk01919,usAAPL
- A-shares still include limit up / limit down detection
- Hong Kong and US outputs do not use A-share limit logic
- Some providers do not return turnover or amount, so those values may be
0 - The analysis behavior and output schema for agents live in
SKILL.md