Skip to content

v1.9.10 — 板块 N 日涨跌幅排行

Choose a tag to compare

@handsomejustin handsomejustin released this 11 Jun 09:41
· 64 commits to main since this release

新功能:板块 N 日涨跌幅排行

新增 board-change-ranking 命令,支持按行业/概念/风格板块计算指定日期前 N 个交易日的涨跌幅并排行。

CLI 用法

# 行业板块 20 日涨跌幅排行(默认全部)
easy-tdx board-change-ranking --table

# 概念板块 10 日涨跌幅排行
easy-tdx board-change-ranking --type GN --days 10 --table

# 指定截止日期
easy-tdx board-change-ranking --type HY --date 20250530 --days 20 --table

# 行业跌幅前 10
easy-tdx board-change-ranking --type HY --top 10 --asc

Python API

from easy_tdx.mac.client import MacClient
from easy_tdx.mac.enums import BoardType

with MacClient.from_best_host() as c:
    # 全部行业板块 20 日涨跌幅
    df = c.get_board_change_ranking(BoardType.HY, days=20)

    # 概念板块指定日期前 10 日涨跌幅 Top 15
    df = c.get_board_change_ranking(
        BoardType.GN, target_date=20250530, days=10, top_n=15
    )

变更摘要

  • 新增 MacClient.get_board_change_ranking() / AsyncMacClient 同名异步方法
  • 新增 CLI 命令 easy-tdx board-change-ranking
  • 利用板块指数 K 线直接计算,无需逐个聚合成分股
  • 支持指定截止日期,周末/节假日自动回退到前一交易日
  • 默认列出全部板块,--top N 截断
  • 12 个单元测试覆盖计算正确性、边界条件、排序方向

Full Changelog: v1.9.9...v1.9.10