feat: 完善 QMT 交易模块文档和配置展示功能

- 优化前端仪表盘界面
- 添加配置文件可视化展示
- 编写 QMT 模块配置文档
- 完善项目规则体系(KiloCode)
This commit is contained in:
2026-01-27 00:52:35 +08:00
parent 50ee1a5a0a
commit 4607555eaf
31 changed files with 5248 additions and 8621 deletions

View File

@@ -12,7 +12,6 @@ import pandas as pd
def prepare_data(
polars_df: pl.DataFrame,
label_horizon: int = 5,
open_col: str = "open",
date_col: str = "trade_date",
code_col: str = "ts_code",
@@ -24,13 +23,13 @@ def prepare_data(
df = polars_df.sort([code_col, date_col])
# 获取 T+1 日的开盘价(作为买入价)
df = df.with_columns([
pl.col(open_col).shift(-1).over(code_col).alias("__buy_price"),
pl.col(open_col).shift(-(1 + label_horizon)).over(code_col).alias("__sell_price"),
]).with_columns([
(pl.col("__sell_price") / pl.col("__buy_price") - 1).alias("label")
]).drop(["__buy_price", "__sell_price"])
# # 获取 T+1 日的开盘价(作为买入价)
# df = df.with_columns([
# pl.col(open_col).shift(-1).over(code_col).alias("__buy_price"),
# pl.col(open_col).shift(-(1 + label_horizon)).over(code_col).alias("__sell_price"),
# ]).with_columns([
# (pl.col("__sell_price") / pl.col("__buy_price") - 1).alias("label")
# ]).drop(["__buy_price", "__sell_price"])
# 转 pandas
df = df.to_pandas()