diff --git a/dashboard/server.py b/dashboard/server.py index 933929b..c53df94 100644 --- a/dashboard/server.py +++ b/dashboard/server.py @@ -236,8 +236,11 @@ async def list_backtests(): @app.get("/api/backtest/{name}") async def get_backtest(name: str): - """Get full backtest result data.""" - fpath = os.path.join(BACKTEST_DIR, f"{name}.json") + """Get full backtest result data — checks historical dir first.""" + # Try historical subdirectory first (where dashboard saves backtests) + fpath = os.path.join(HISTORICAL_DIR, f"{name}.json") + if not os.path.exists(fpath): + fpath = os.path.join(BACKTEST_DIR, f"{name}.json") if os.path.exists(fpath): with open(fpath) as f: return JSONResponse(json.load(f))