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:
+2
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user