revert: drop exit-gate configurability, hardcode the replay-validated values

Operator call: no per-strategy configurability for exit pacing — it added
config fields, UI and plumbing nobody wanted. Back to plain constants in
auto_trader_throttle.go, now set to the replay-validated values instead
of the original guesses (4154 cycles, 3-fold robust search over only the
7 exit params, everything else fixed at the live config):

- min hold 90m, noise-close window 3h, noise band -2%..+3%,
  bypasses -3%/+8% (all inside the searched top-20 ranges)
- re-entry cooldown 4h — the one clear signal: top-20 configs cluster
  tightly at 3.8-4.0h; re-entering a just-closed symbol was a consistent
  loss source

Removes the 7 RiskControlConfig fields + accessors, the Strategy Studio
'exit pacing' row, the frontend type fields, and the fields from stored
strategy configs in data/data.db. Prompt guidance is static text again,
matching the constants.
This commit is contained in:
tinkle-community
2026-07-26 13:27:59 +09:00
parent 434301cb09
commit 574ddfb1ae
6 changed files with 47 additions and 241 deletions

View File

@@ -215,7 +215,7 @@ func (e *StrategyEngine) buildVergexSystemPrompt(accountEquity float64, variant
sb.WriteString("- Ranking alone is not an entry reason; it only defines the candidate pool.\n")
sb.WriteString("- Every symbol in Candidate Coins is part of the allowed trading universe; missing detail can lower confidence or trigger waiting, but does not make the symbol non-tradable.\n")
sb.WriteString("- If Signal Lab or heatmap is absent from that symbol's Vergex Claw402 Signals, state it in reasoning; if it is present, never claim the symbol lacks that data.\n")
sb.WriteString(vergexHoldRules(riskControl))
sb.WriteString(vergexHoldRules())
} else {
sb.WriteString("# You are the NOFX Claw402 auto-trader\n\n")
sb.WriteString("Trade only Hyperliquid instruments returned by this cycle's Claw402.ai/Vergex board. You may trade only the current candidate symbols and existing positions; never invent tickers or rotate outside the provided universe.\n\n")
@@ -230,7 +230,7 @@ func (e *StrategyEngine) buildVergexSystemPrompt(accountEquity float64, variant
sb.WriteString("- Ranking alone is not an entry reason; it only defines the candidate pool.\n")
sb.WriteString("- Every symbol in Candidate Coins is part of the allowed trading universe; missing detail can lower confidence or trigger waiting, but does not make the symbol non-tradable.\n")
sb.WriteString("- If Signal Lab or heatmap is absent from that symbol's Vergex Claw402 Signals, state it in reasoning; if it is present, never claim the symbol lacks that data.\n")
sb.WriteString(vergexHoldRules(riskControl))
sb.WriteString(vergexHoldRules())
}
writeModeVariant(&sb, variant, zh)
@@ -255,34 +255,13 @@ func (e *StrategyEngine) buildVergexSystemPrompt(accountEquity float64, variant
// vergexCustomPromptSection returns the user's custom prompt for the vergex
// path, dropping legacy directional overrides ("long only" era) that would
// contradict the data-driven direction rule baked into this prompt.
// vergexHoldRules renders the anti-churn hold/exit guidance from the
// strategy's configurable exit gates so the prompt always matches what the
// code-enforced throttle will actually allow.
func vergexHoldRules(riskControl store.RiskControlConfig) string {
fmtDur := func(d time.Duration) string {
mins := int(d.Minutes())
if mins < 60 {
return fmt.Sprintf("%d minutes", mins)
}
if mins%60 == 0 {
return fmt.Sprintf("%d hours", mins/60)
}
return fmt.Sprintf("%.1f hours", d.Hours())
}
return fmt.Sprintf(
"- Hold for meaningful moves, do not churn: hold new positions for at least %s; never close inside the %.1f%%..%.1f%% noise band before ~%s; after closing a symbol wait %s before re-entry; open at most 1-2 new positions per hour. Small in-and-out trades bled this account to death on fees.\n"+
"- Fees are the main edge killer: a round trip costs ~0.1%% of notional. Only take setups whose realistic target is well beyond fees: stop-loss around %.1f%% and take-profit around +%.1f%% or beyond. Do not aim for 0.2-0.3%% scalps — they cannot cover fees.\n"+
"- Give positions room to develop: place stops beyond short-term noise (around %.1f%%) and targets at meaningful heatmap resistance/liquidation zones (around +%.1f%%). Do not exit on small green or small red.\n\n",
fmtDur(riskControl.MinHold()),
riskControl.NoiseFloorPct(),
riskControl.NoiseCeilingPct(),
fmtDur(riskControl.NoiseHold()),
fmtDur(riskControl.ReentryCooldown()),
riskControl.StopBypassPct(),
riskControl.TPBypassPct(),
riskControl.StopBypassPct(),
riskControl.TPBypassPct(),
)
// vergexHoldRules is the anti-churn hold/exit guidance. The numbers mirror
// the code-enforced throttle constants in trader/auto_trader_throttle.go —
// keep the two in sync when retuning.
func vergexHoldRules() string {
return "- Hold for meaningful moves, do not churn: hold new positions for at least 90 minutes; never close inside the -2%..+3% noise band before ~3 hours; after closing a symbol wait 4 hours before re-entry; open at most 1-2 new positions per hour. Small in-and-out trades bled this account to death on fees.\n" +
"- Fees are the main edge killer: a round trip costs ~0.1% of notional. Only take setups whose realistic target is well beyond fees: stop-loss around -3% and take-profit around +8% or beyond. Do not aim for 0.2-0.3% scalps — they cannot cover fees.\n" +
"- Give positions room to develop: place stops beyond short-term noise (around -3%) and targets at meaningful heatmap resistance/liquidation zones (around +8%). Do not exit on small green or small red.\n\n"
}
func vergexCustomPromptSection(section string) string {