mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-22 03:37:36 +08:00
config: stop the churn — hold for big moves, wide TP/SL, low leverage
Live decomposition of the losing streak: 23% win rate with avg win +$1.23 / avg loss -$1.04 on ~0.3-0.5% price moves, where the ~0.14% round-trip fee ate 30-50% of every tiny winner. Death by small-move grinding. The AI was closing positions on ±0.5% noise after the 60m min-hold, capping winners at ~0.86%. Redesign to 'few big positions, held for big moves': - Throttle: min hold 60m->4h, noise-close window 90m->8h, reentry 30m->3h, opens/hour 30->3, opens/cycle 6->2. Noise band widened -1%..+2% -> -4%..+6% so small moves can no longer trigger a close. - Exits: stop bypass -2.5% -> -5%, take-profit bypass +5% -> +12% (wide, asymmetric — let winners run, cut losers only on a real move). - Leverage 20x -> 5x: a -5% stop at 20x is instant liquidation; at 5x it is -25% of margin, survivable. 2 positions x 2.5x = 5x total (full margin, ~20% cushion) instead of 4x5x=20x. - Prompt now instructs the AI to set wide stops (~-5%) and distant targets (~+10-12%), hold multi-hour, and never scalp 0.5% moves. Live strategy updated (maxPos=2, lev=5, ratio=2.5).
This commit is contained in:
@@ -262,15 +262,14 @@ func (s *Server) createDefaultStrategies(userID string, lang string) error {
|
||||
c.CoinSource.VergexLimit = 10
|
||||
c.CoinSource.VergexMarketType = "all"
|
||||
c.CoinSource.VergexChain = "hyperliquid"
|
||||
c.RiskControl.MaxPositions = 4
|
||||
c.RiskControl.BTCETHMaxLeverage = 20
|
||||
c.RiskControl.AltcoinMaxLeverage = 20
|
||||
// 5× equity notional per position: 4 positions = 20x total account
|
||||
// notional (full margin, ~5% liquidation cushion). Aggressive by
|
||||
// operator choice — bigger single positions; the 0.4 short-signal
|
||||
// floor keeps the book balanced so it is not a one-directional bet.
|
||||
c.RiskControl.BTCETHMaxPositionValueRatio = 5.0
|
||||
c.RiskControl.AltcoinMaxPositionValueRatio = 5.0
|
||||
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.MaxMarginUsage = 1.0
|
||||
c.RiskControl.MinConfidence = 78
|
||||
c.RiskControl.MinRiskRewardRatio = 3.0
|
||||
|
||||
@@ -54,16 +54,16 @@ func TestCreateDefaultStrategiesUsesOneReadyToRunClaw402Preset(t *testing.T) {
|
||||
if trendCfg.CoinSource.SourceType != "vergex_signal" || trendCfg.CoinSource.VergexLimit != 10 || trendCfg.CoinSource.VergexMarketType != "all" {
|
||||
t.Fatalf("default strategy should use the Claw402/Vergex all-market signal ranking, got %+v", trendCfg.CoinSource)
|
||||
}
|
||||
if trendCfg.CoinSource.UseAI500 || trendCfg.RiskControl.MaxPositions != 4 {
|
||||
t.Fatalf("default strategy should be Claw402/Vergex native with a 4-position balanced book, got coin=%+v risk=%+v", trendCfg.CoinSource, trendCfg.RiskControl)
|
||||
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 != 20 || trendCfg.RiskControl.AltcoinMaxLeverage != 20 {
|
||||
t.Fatalf("default strategy should use 20x leverage for all Claw402 opens, got risk=%+v", 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.BTCETHMaxPositionValueRatio != 5 ||
|
||||
trendCfg.RiskControl.AltcoinMaxPositionValueRatio != 5 ||
|
||||
if trendCfg.RiskControl.BTCETHMaxPositionValueRatio != 2.5 ||
|
||||
trendCfg.RiskControl.AltcoinMaxPositionValueRatio != 2.5 ||
|
||||
trendCfg.RiskControl.MaxMarginUsage != 1.0 {
|
||||
t.Fatalf("default strategy should size Claw402 opens at 5x equity notional (4 positions = 20x total at 20x), got risk=%+v", trendCfg.RiskControl)
|
||||
t.Fatalf("default strategy should size Claw402 opens at 2.5x equity notional (2 positions = 5x total at 5x), got risk=%+v", trendCfg.RiskControl)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user