Files
quanxiel/alpha/config.py
T
2026-07-31 21:23:35 +08:00

42 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
阿尔法模块配置
"""
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class AlphaConfig:
"""阿尔法研究全局配置"""
# ---- 数据库 ----
db_host: str = "192.168.27.15"
db_port: int = 12345
db_name: str = "quant_db"
db_user: str = "postgres"
db_password: str = "postgres"
# ---- 回测基础参数 ----
initial_cash: float = 1_000_000.0 # 初始资金
benchmark: str = "000300.SH" # 基准指数(沪深300
start_date: str = "2020-01-01"
end_date: str = "2025-12-31"
# ---- 交易成本 ----
commission_rate: float = 0.0003 # 佣金费率
slippage: float = 0.001 # 滑点(百分比)
stamp_tax: float = 0.001 # 印花税(仅卖出)
# ---- 组合约束 ----
max_position_pct: float = 0.10 # 单票最大仓位
max_turnover: float = 0.20 # 单日最大换手率
min_holding_period: int = 1 # 最小持仓天数
# ---- 因子研究参数 ----
factor_windows: List[int] = field(default_factory=lambda: [5, 10, 20, 60])
ic_decay_days: int = 20 # IC 衰减分析天数
# ---- 输出 ----
output_dir: str = "./output"
save_trade_log: bool = True
verbose: bool = False