Fix dashboard backtest detail, deterministic backtest seeds, paper trader fees, live node crash guard

Backtest detail: openDetail() now fetches full backtest JSON from the API
instead of showing "Full trade data not in summary". Renders equity curve
chart + full trade history table with 100 rows.

Backtest reproducibility: replaced hash(key) with fixed per-strategy seeds.
Python's hash() is randomized per process (PYTHONHASHSEED), causing wildly
different results for same strategy across runs. Now deterministic.

Server: added total_trades and sortino to /api/backtests summary response.

Paper trader: fixed Avellaneda-Stoikov simulate using TAKER_FEE instead of
MAKER_FEE. Lowered OBI signal threshold from 5bps to 1.5bps for flat markets.

Live node: added None-guard in get_mark_prices — Hyperliquid testnet API
sometimes returns null, crashing the node. Wrapped in try/except.
This commit is contained in:
ramseshk
2026-08-04 07:07:15 +00:00
parent 1c83fd378e
commit e4de21192a
17 changed files with 43315 additions and 16 deletions
+5 -1
View File
@@ -27,7 +27,11 @@ CONFIGS = {
}
def simulate(key, periods=720):
random.seed(hash(key)%2**32)
# Deterministic seed per strategy (hash() is randomized per Python process)
_fixed_seeds = {"ofi":42,"iceberg":43,"funding_arb":44,"pairs":45,"avellaneda":46,
"momentum":47,"mean_rev":48,"hawkes":49,"deep_lob":50,
"cartea":51,"queue_imb":52,"gueant":53}
random.seed(_fixed_seeds.get(key, 42))
cfg = CONFIGS[key]
hr = cfg["daily_ret"]/24; hv = cfg["daily_vol"]/(24**0.5)
eq=100.0; curve=[]; rets=[]; trades=[]