feat: restructure OKX options UI with header funds, settings card, and dual-column layout
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -85,11 +85,18 @@ def profit_loss_ratio_from_trades(trades: list[dict[str, Any]] | None) -> float
|
||||
return profit_loss_ratio_from_averages(avg_win, avg_loss)
|
||||
|
||||
|
||||
def total_funds_usdt(funding_usdt: float | None, trading_usdt: float | None) -> float | None:
|
||||
def total_funds_usdt(
|
||||
funding_usdt: float | None,
|
||||
trading_usdt: float | None,
|
||||
options_trading_usdc: float | None = None,
|
||||
) -> float | None:
|
||||
if funding_usdt is None:
|
||||
return None
|
||||
try:
|
||||
return round(float(funding_usdt) + float(trading_usdt or 0), 2)
|
||||
total = float(funding_usdt) + float(trading_usdt or 0)
|
||||
if options_trading_usdc is not None:
|
||||
total += float(options_trading_usdc)
|
||||
return round(total, 2)
|
||||
except (TypeError, ValueError):
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user