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)
This commit is contained in:
@@ -51,7 +51,8 @@ def resample_ohlc(df: pd.DataFrame, rule: str) -> pd.DataFrame:
|
|||||||
{"open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum"})
|
{"open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum"})
|
||||||
out = out.dropna(subset=["open"])
|
out = out.dropna(subset=["open"])
|
||||||
out["datetime"] = out.index
|
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"]]
|
return out.reset_index(drop=True)[["timestamp", "open", "high", "low", "close", "volume", "datetime"]]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user