Spaces:
Running
Running
Sync from GitHub (tests passed)
Browse files- backtest/runner.py +2 -1
backtest/runner.py
CHANGED
|
@@ -186,7 +186,8 @@ class BacktestRunner:
|
|
| 186 |
raise ValueError("No price data fetched")
|
| 187 |
|
| 188 |
result = pd.concat(all_data, ignore_index=True)
|
| 189 |
-
|
|
|
|
| 190 |
return result
|
| 191 |
|
| 192 |
def prepare_features(self, prices: pd.DataFrame, target_symbol: str = "HG=F") -> pd.DataFrame:
|
|
|
|
| 186 |
raise ValueError("No price data fetched")
|
| 187 |
|
| 188 |
result = pd.concat(all_data, ignore_index=True)
|
| 189 |
+
# Handle tz-aware dates from yfinance
|
| 190 |
+
result['date'] = pd.to_datetime(result['date'], utc=True).dt.tz_localize(None)
|
| 191 |
return result
|
| 192 |
|
| 193 |
def prepare_features(self, prices: pd.DataFrame, target_symbol: str = "HG=F") -> pd.DataFrame:
|