Funding Rate Arb: historical backtests running (was pass/skip)

Historical runner:
  - funding_arb was just "pass" — replaced with hourly trend proxy
  - Annualizes 1h return as funding rate: rate = ret_1h * 365 * 24
  - Entry when |annual_rate| > 3%, scales strength with rate

Backtest results (30-day, 720h candles):
  BTC: +146.94% net, 75% win, 72 trades
  ETH: -13.76% net, 69% win, 87 trades
  HYPE: -0.95% net, 73% win, 63 trades
  VVV: +0.10% net, 78% win, 86 trades

Total: 32 historical backtests (8 strategies x 4 coins)
Cleaned 4 duplicate files from old names
This commit is contained in:
ramseshk
2026-08-05 07:10:39 +00:00
parent 70d43fefe0
commit 803a38b237
7 changed files with 10368 additions and 7279 deletions
+8 -3
View File
@@ -145,9 +145,14 @@ def simulate_strategy_on_candles(
reason = f"Iceberg: {up_count}/10 upward ticks"
signal_strength = 1 - up_count / 10
elif key == "funding_arb":
# Funding rate arb: need real funding data — skip for candle-only backtest
pass
elif key == "funding_arb" and len(prices_20) >= 20:
# Funding Rate Arb: hourly price trend as funding proxy
long_return = (close - prices_20[0]) / prices_20[0]
annual_rate = long_return * 365 * 24 # hourly to annual
if abs(annual_rate) > 0.03: # >3% annualized
signal = "SELL" if annual_rate > 0 else "BUY"
reason = f"Fund: {annual_rate*100:.1f}% APR ({long_return*100:.2f}% 1h)"
signal_strength = min(1.0, abs(annual_rate) * 5)
elif key == "pairs" and len(prices_20) >= 20:
# Pairs: BTC/ETH ratio Z-score (only works if we have both)