Add risk-based position sizing (以损定仓) with per-open k resize.

Manual vs risk modes are exclusive; each open floors k to 1 decimal so estimated premium+fees stay within the loss budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 23:32:42 +08:00
parent 0b51aa15ff
commit 3a4c8d639c
9 changed files with 803 additions and 16 deletions
+7
View File
@@ -323,6 +323,13 @@ export type StrategySettings = {
perp_qty_eth?: number;
option_qty_eth?: number;
show_manual_trade_buttons?: boolean;
sizing_mode?: "manual" | "risk_based";
risk_loss_mode?: "percent" | "absolute";
risk_loss_pct?: number;
risk_loss_usdt?: number;
risk_capital_source?: "trading_account" | "manual";
risk_manual_capital_usdt?: number;
risk_sizing_preview?: Record<string, unknown>;
exchange?: string;
};