From 3b6ff02197fa81afc34a01d07309dfac7a60d205 Mon Sep 17 00:00:00 2001 From: AdrianoDev Date: Fri, 19 Jun 2026 20:18:03 +0200 Subject: [PATCH] fix: resolution-safe timestamp in trackD_timing resample (pandas 2.x datetime64[ms]) - combination study: PORT LF4h (BTC+ETH) Sharpe 1.32 DD 12.3% remains best - RV ETH/BTC market-neutral sleeve is genuinely uncorrelated (~0.05) but too weak (Sharpe 0.27) to raise portfolio Sharpe; combining the two TF configs is redundant (same-asset cross-config corr 0.80) --- scripts/research/trackD_timing.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/research/trackD_timing.py b/scripts/research/trackD_timing.py index 4b67568..e52ff6b 100644 --- a/scripts/research/trackD_timing.py +++ b/scripts/research/trackD_timing.py @@ -51,7 +51,8 @@ def resample_ohlc(df: pd.DataFrame, rule: str) -> pd.DataFrame: {"open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum"}) out = out.dropna(subset=["open"]) out["datetime"] = out.index - out["timestamp"] = (out.index.view("int64") // 1_000_000) + epoch = pd.Timestamp("1970-01-01", tz="UTC") + out["timestamp"] = ((out.index - epoch) // pd.Timedelta(milliseconds=1)).astype("int64") return out.reset_index(drop=True)[["timestamp", "open", "high", "low", "close", "volume", "datetime"]]