第一版策略

This commit is contained in:
ddrwode
2026-02-28 13:27:54 +08:00
parent fe87f49734
commit 302086b7d5

View File

@@ -255,6 +255,13 @@ def run_grid_search(
done_combos = 0
for task in tasks:
res = _eval_period_task(task)
period = task[0]
# 打印该period的所有结果
for row in res:
print(f"✓ period={int(row['period']):4d}, std={float(row['std']):7.2f} | "
f"收益: {row['ret_pct']:+7.2f}% | 回撤: {row['max_dd_pct']:6.2f}% | "
f"夏普: {row['sharpe']:7.3f} | 交易: {int(row['n_trades']):6d} | "
f"评分: {row['stable_score']:7.1f}")
rows.extend(res)
done_periods += 1
done_combos += len(task[1])
@@ -275,6 +282,12 @@ def run_grid_search(
for fut in as_completed(future_map):
period, stds = future_map[fut]
res = fut.result()
# 打印该period的所有结果
for row in res:
print(f"✓ period={int(row['period']):4d}, std={float(row['std']):7.2f} | "
f"收益: {row['ret_pct']:+7.2f}% | 回撤: {row['max_dd_pct']:6.2f}% | "
f"夏普: {row['sharpe']:7.3f} | 交易: {int(row['n_trades']):6d} | "
f"评分: {row['stable_score']:7.1f}")
rows.extend(res)
done_periods += 1
done_combos += len(stds)
@@ -289,6 +302,12 @@ def run_grid_search(
done_combos = 0
for task in tasks:
res = _eval_period_task(task)
# 打印该period的所有结果
for row in res:
print(f"✓ period={int(row['period']):4d}, std={float(row['std']):7.2f} | "
f"收益: {row['ret_pct']:+7.2f}% | 回撤: {row['max_dd_pct']:6.2f}% | "
f"夏普: {row['sharpe']:7.3f} | 交易: {int(row['n_trades']):6d} | "
f"评分: {row['stable_score']:7.1f}")
rows.extend(res)
done_periods += 1
done_combos += len(task[1])