mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-28 22:42:52 +08:00
config: raise leverage 5x -> 10x, double book to 2 x 5x notional
Operator choice to add aggression while keeping the hold-for-big-moves design intact: - Leverage 5x -> 10x: a wide -5% stop is now -50% of margin — still survivable, not an instant liquidation (that needed 20x). - Per-position notional 2.5x -> 5x equity; 2 positions = 10x total account notional (full margin at 10x, ~10% liquidation cushion). - Stops/targets, throttle, min-hold and noise-band settings unchanged: same wide (-5% / +10-12%) exits, doubled exposure. Live strategy in data/data.db updated to match (lev=10, ratio=5.0).
This commit is contained in:
@@ -263,13 +263,13 @@ func (s *Server) createDefaultStrategies(userID string, lang string) error {
|
||||
c.CoinSource.VergexMarketType = "all"
|
||||
c.CoinSource.VergexChain = "hyperliquid"
|
||||
c.RiskControl.MaxPositions = 2
|
||||
c.RiskControl.BTCETHMaxLeverage = 5
|
||||
c.RiskControl.AltcoinMaxLeverage = 5
|
||||
// Few, concentrated positions held for big moves. 5x leverage so a
|
||||
// wide (-5%) stop is survivable rather than an instant liquidation;
|
||||
// 2 positions × 2.5x = 5x total notional (full margin, ~20% cushion).
|
||||
c.RiskControl.BTCETHMaxPositionValueRatio = 2.5
|
||||
c.RiskControl.AltcoinMaxPositionValueRatio = 2.5
|
||||
c.RiskControl.BTCETHMaxLeverage = 10
|
||||
c.RiskControl.AltcoinMaxLeverage = 10
|
||||
// Few, concentrated positions held for big moves. 10x leverage keeps a
|
||||
// wide (-5%) stop survivable (~-50% margin, ~10% liquidation cushion);
|
||||
// 2 positions × 5x = 10x total notional (full margin, doubled exposure).
|
||||
c.RiskControl.BTCETHMaxPositionValueRatio = 5.0
|
||||
c.RiskControl.AltcoinMaxPositionValueRatio = 5.0
|
||||
c.RiskControl.MaxMarginUsage = 1.0
|
||||
c.RiskControl.MinConfidence = 78
|
||||
c.RiskControl.MinRiskRewardRatio = 3.0
|
||||
|
||||
@@ -57,13 +57,13 @@ func TestCreateDefaultStrategiesUsesOneReadyToRunClaw402Preset(t *testing.T) {
|
||||
if trendCfg.CoinSource.UseAI500 || trendCfg.RiskControl.MaxPositions != 2 {
|
||||
t.Fatalf("default strategy should be Claw402/Vergex native with a 2-position concentrated book, got coin=%+v risk=%+v", trendCfg.CoinSource, trendCfg.RiskControl)
|
||||
}
|
||||
if trendCfg.RiskControl.BTCETHMaxLeverage != 5 || trendCfg.RiskControl.AltcoinMaxLeverage != 5 {
|
||||
t.Fatalf("default strategy should use 5x leverage for all Claw402 opens, got risk=%+v", trendCfg.RiskControl)
|
||||
if trendCfg.RiskControl.BTCETHMaxLeverage != 10 || trendCfg.RiskControl.AltcoinMaxLeverage != 10 {
|
||||
t.Fatalf("default strategy should use 10x leverage for all Claw402 opens, got risk=%+v", trendCfg.RiskControl)
|
||||
}
|
||||
if trendCfg.RiskControl.BTCETHMaxPositionValueRatio != 2.5 ||
|
||||
trendCfg.RiskControl.AltcoinMaxPositionValueRatio != 2.5 ||
|
||||
if trendCfg.RiskControl.BTCETHMaxPositionValueRatio != 5.0 ||
|
||||
trendCfg.RiskControl.AltcoinMaxPositionValueRatio != 5.0 ||
|
||||
trendCfg.RiskControl.MaxMarginUsage != 1.0 {
|
||||
t.Fatalf("default strategy should size Claw402 opens at 2.5x equity notional (2 positions = 5x total at 5x), got risk=%+v", trendCfg.RiskControl)
|
||||
t.Fatalf("default strategy should size Claw402 opens at 5x equity notional (2 positions = 10x total at 10x), got risk=%+v", trendCfg.RiskControl)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ func TestBuildSystemPromptUsesVergexClaw402Prompt(t *testing.T) {
|
||||
if !strings.Contains(prompt, "Direction must be data-driven") {
|
||||
t.Fatalf("prompt should explain that direction is data-driven, not long-only:\n%s", prompt)
|
||||
}
|
||||
if !strings.Contains(prompt, "every open position must use exactly 5x") {
|
||||
t.Fatalf("prompt should force 5x leverage for Claw402 opens:\n%s", prompt)
|
||||
if !strings.Contains(prompt, "every open position must use exactly 10x") {
|
||||
t.Fatalf("prompt should force 10x leverage for Claw402 opens:\n%s", prompt)
|
||||
}
|
||||
if !strings.Contains(prompt, "use the full max notional per position") {
|
||||
t.Fatalf("prompt should force full-size Claw402 opens:\n%s", prompt)
|
||||
|
||||
@@ -1015,10 +1015,10 @@ func GetDefaultStrategyConfig(lang string) StrategyConfig {
|
||||
},
|
||||
RiskControl: RiskControlConfig{
|
||||
MaxPositions: 2, // Few, concentrated positions held for big moves (CODE ENFORCED)
|
||||
BTCETHMaxLeverage: 5, // Low leverage so a big (-5%) stop is survivable, not an instant liquidation
|
||||
AltcoinMaxLeverage: 5, // Low leverage so a big (-5%) stop is survivable, not an instant liquidation
|
||||
BTCETHMaxPositionValueRatio: 2.5, // Per-position notional = equity × 2.5; 2 positions = 5x total (full margin at 5x, ~20% liquidation cushion)
|
||||
AltcoinMaxPositionValueRatio: 2.5, // Per-position notional = equity × 2.5; 2 positions = 5x total (full margin at 5x, ~20% liquidation cushion)
|
||||
BTCETHMaxLeverage: 10, // Moderate leverage: a wide (-5%) stop is ~-50% margin, survivable, not an instant liquidation
|
||||
AltcoinMaxLeverage: 10, // Moderate leverage: a wide (-5%) stop is ~-50% margin, survivable, not an instant liquidation
|
||||
BTCETHMaxPositionValueRatio: 5.0, // Per-position notional = equity × 5; 2 positions = 10x total (full margin at 10x, ~10% liquidation cushion)
|
||||
AltcoinMaxPositionValueRatio: 5.0, // Per-position notional = equity × 5; 2 positions = 10x total (full margin at 10x, ~10% liquidation cushion)
|
||||
MaxMarginUsage: 1.0, // Claw402 Autopilot intentionally uses full margin when opening
|
||||
MinPositionSize: 12, // Min 12 USDT per position (CODE ENFORCED)
|
||||
MinRiskRewardRatio: 3.0, // Min 3:1 profit/loss ratio (AI guided)
|
||||
|
||||
@@ -1389,12 +1389,12 @@ export function StrategyStudioPage() {
|
||||
risk_control: defaultRisk({
|
||||
...base.ai_config?.risk_control,
|
||||
max_positions: 2,
|
||||
btc_eth_max_leverage: 5,
|
||||
altcoin_max_leverage: 5,
|
||||
// Few, concentrated positions held for big moves. 5x leverage so a
|
||||
// wide (-5%) stop is survivable; 2 positions × 2.5x = 5x total.
|
||||
btc_eth_max_position_value_ratio: 2.5,
|
||||
altcoin_max_position_value_ratio: 2.5,
|
||||
btc_eth_max_leverage: 10,
|
||||
altcoin_max_leverage: 10,
|
||||
// Few, concentrated positions held for big moves. 10x leverage keeps a
|
||||
// wide (-5%) stop survivable; 2 positions × 5x = 10x total.
|
||||
btc_eth_max_position_value_ratio: 5,
|
||||
altcoin_max_position_value_ratio: 5,
|
||||
max_margin_usage: 1.0,
|
||||
min_confidence: 78,
|
||||
min_risk_reward_ratio: 3,
|
||||
|
||||
Reference in New Issue
Block a user