auto_trade_sys/scripts/shadow_mode_analyzer.py
2026-03-21 09:23:53 +08:00

36 lines
1.1 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.

#!/usr/bin/env python3
"""
影子模式分析(占位入口)。
实际流程建议:
1. 由 `daily_report.py` 或独立分析脚本根据历史成交生成 `config/current_suggestions.json`
2. 更新 `config/shadow_mode_tracking.json` 中的 accuracy / rolling_accuracy
3. 在全局配置中开启 `SHADOW_MODE_AUTO_APPLY=true` 后,交易进程将自动读取建议。
本仓库提供 JSON schema 见 `config/current_suggestions.json`。
"""
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
SUG = ROOT / "config" / "current_suggestions.json"
TRACK = ROOT / "config" / "shadow_mode_tracking.json"
def main():
print("影子模式分析占位脚本。")
print(f" 建议文件: {SUG}")
print(f" 跟踪文件: {TRACK}")
if SUG.is_file():
with open(SUG, "r", encoding="utf-8") as f:
data = json.load(f)
print(" 当前建议摘要:", {k: len(v) if isinstance(v, list) else v for k, v in data.items()})
else:
print(" (尚未生成 current_suggestions.json")
sys.exit(0)
if __name__ == "__main__":
main()