fix etc yaml

This commit is contained in:
2026-09-18 19:07:43 +08:00
parent 892f6c3a81
commit a87c656574
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
# 标的是示例白名单;仅在账户配置 strategy: etf 时启用。 # 标的是示例白名单;仅在账户配置 strategy: etf 时启用。
codes: codes:
- "510300.SH" - "588000.SH" # 华夏上证科创板50成份ETF
- "159915.SZ" - "510300.SH" # 沪深300ETF华泰柏瑞
- "518880.SH" # 安易富黄金ETF
# 固定买入手数,每手 100 份;每只 ETF 总持仓硬上限 10 手。 # 固定买入手数,每手 100 份;每只 ETF 总持仓硬上限 10 手。
buy_hands: 1 buy_hands: 1
max_hands: 10 max_hands: 10

View File

@@ -49,7 +49,7 @@ class ETFConfig:
def load(path: str | Path | None = None) -> ETFConfig: def load(path: str | Path | None = None) -> ETFConfig:
path = Path(path) if path else Path(__file__).resolve().parents[2] / 'etc' / 'etf.yaml' path = Path(path) if path else Path(__file__).resolve().parents[2] / 'etc' / '_etf.yaml'
try: try:
raw = yaml.safe_load(path.read_text(encoding='utf-8')) raw = yaml.safe_load(path.read_text(encoding='utf-8'))
except (OSError, yaml.YAMLError) as exc: except (OSError, yaml.YAMLError) as exc: