Comprehensive fix: live node resilience + CSS contrast + win_rate + equity curves

- Mainnet API fallback when testnet unavailable (prices, orderbook, instruments)
- Bypassed broken SDK instrument loading, uses raw mainnet meta API
- Dynamic BTC/ETH perp ID lookup (handles "-USD-PERP" suffix changes)
- Strategy-level equity tracking for per-strategy detail charts
- Win rate fixed: checks pnl_net/pnl_gross not just pnl field
- CSS contrast improved: --tx #6b6b7b→#9e9eae, borders/highlights brightened
- Equity curve recalculated on fee tier change (chart adjusts visually)
- Added Open Positions & Orders panel placeholder
This commit is contained in:
ramseshk
2026-08-05 02:53:31 +00:00
parent f45417c105
commit 4457cdffc5
5 changed files with 706 additions and 251 deletions
+2 -1
View File
@@ -40,4 +40,5 @@ def max_drawdown(equity: list[float]) -> float:
def win_rate(trades: list[dict]) -> float:
if not trades:
return 0.0
return sum(1 for t in trades if t.get("pnl", 0) > 0) / len(trades)
tp = sum(1 for t in trades if (t.get("pnl_net") or t.get("pnl_gross") or t.get("pnl", 0)) > 0)
return tp / len(trades)