19 lines
782 B
Python
19 lines
782 B
Python
import os
|
|
import glob
|
|
import json
|
|
|
|
results_dir = "kis_trader/backtest/results"
|
|
for strat in ["BREAKOUT", "SCALP"]:
|
|
pattern = f"optuna_{strat.lower()}_fast_20*.json"
|
|
files = glob.glob(os.path.join(results_dir, pattern))
|
|
if not files: continue
|
|
latest_file = max(files, key=os.path.getmtime)
|
|
with open(latest_file, 'r', encoding='utf-8') as f:
|
|
data = json.load(f)
|
|
ws = data.get("whipsaw_recommend", {})
|
|
if ws.get("ok"):
|
|
orig = ws.get("orig_stats", {})
|
|
rec = ws.get("recommended_stats", {})
|
|
print(f"[{strat}] Original: WinRate {orig.get('win_rate')}% (count: {orig.get('count')}), PnL: {orig.get('pnl')}")
|
|
print(f"[{strat}] Recommnd: WinRate {rec.get('win_rate')}% (count: {rec.get('count')}), PnL: {rec.get('pnl')}")
|