Files
jyx_code4/run_scheme_b_train.py
ddrwode 29c1b3ffd1 哈哈
2026-02-20 21:37:52 +08:00

22 lines
939 B
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 python
"""
仅运行方案BLightGBM训练并保存模型供实盘脚本 get_live_signal 使用。
需先保证 models/database.db 中有 15m/5m/1h K 线(例如运行 抓取多周期K线.py
"""
import argparse
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from strategy.ai_strategy import run_ai_strategy
if __name__ == '__main__':
p = argparse.ArgumentParser(description='方案B 训练并保存模型(实盘用)')
p.add_argument('--period', type=int, default=15, help='主周期分钟,默认 15')
p.add_argument('--start', type=str, default=None, help='回测开始日期,如 2024-01-01')
p.add_argument('--end', type=str, default=None, help='回测结束日期,如 2024-12-31')
args = p.parse_args()
run_ai_strategy(model_type='lightgbm', period=args.period,
start_date=args.start, end_date=args.end)