MCPcopy Create free account
hub / github.com/NoFxAiOS/nofx / buildVergexSystemPrompt

Method buildVergexSystemPrompt

kernel/engine_prompt.go:186–244  ·  view source on GitHub ↗
(accountEquity float64, variant string, lang Language, zh bool, singleSymbol bool, primarySymbol string)

Source from the content-addressed store, hash-verified

184}
185
186func (e *StrategyEngine) buildVergexSystemPrompt(accountEquity float64, variant string, lang Language, zh bool, singleSymbol bool, primarySymbol string) string {
187 var sb strings.Builder
188 riskControl := e.config.RiskControl
189
190 writeVergexSchemaPrompt(&sb, zh)
191 sb.WriteString("\n\n---\n\n")
192
193 if zh {
194 sb.WriteString("# You are the NOFX Claw402 auto-trader\n\n")
195 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")
196 sb.WriteString("# Decision Data Priority\n\n")
197 sb.WriteString("1. Claw402.ai Signal Ranking: candidate pool, rank, direction and category.\n")
198 sb.WriteString("2. Claw402.ai Signal Lab: trend, momentum, event/model confirmation; this is the core pre-entry confirmation source.\n")
199 sb.WriteString("3. Claw402.ai Cost/Liquidation Heatmap: crowded liquidation/cost zones, stop placement and target zones.\n")
200 sb.WriteString("4. Raw OHLCV candles: entry timing, trend structure, volatility and risk/reward validation.\n\n")
201 sb.WriteString("# Trading Rules\n\n")
202 sb.WriteString("- Manage existing positions before opening new ones.\n")
203 sb.WriteString("- Open only when Signal Lab, heatmap and raw candles broadly agree; wait when key data is missing or contradictory.\n")
204 sb.WriteString("- Ranking alone is not an entry reason; it only defines the candidate pool.\n")
205 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")
206 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")
207 sb.WriteString("- Avoid churn: unless stopping out or taking a strong profit, hold new positions for at least 45 minutes; avoid flat/noise closes until roughly 90 minutes; after closing a symbol, wait 90 minutes before re-entry; open at most 1 new position per hour.\n")
208 sb.WriteString("- Stops must sit beyond invalidation; targets should prefer heatmap resistance/liquidation zones or valid risk/reward levels.\n\n")
209 } else {
210 sb.WriteString("# You are the NOFX Claw402 auto-trader\n\n")
211 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")
212 sb.WriteString("# Decision Data Priority\n\n")
213 sb.WriteString("1. Claw402.ai Signal Ranking: candidate pool, rank, direction and category.\n")
214 sb.WriteString("2. Claw402.ai Signal Lab: trend, momentum, event/model confirmation; this is the core pre-entry confirmation source.\n")
215 sb.WriteString("3. Claw402.ai Cost/Liquidation Heatmap: crowded liquidation/cost zones, stop placement and target zones.\n")
216 sb.WriteString("4. Raw OHLCV candles: entry timing, trend structure, volatility and risk/reward validation.\n\n")
217 sb.WriteString("# Trading Rules\n\n")
218 sb.WriteString("- Manage existing positions before opening new ones.\n")
219 sb.WriteString("- Open only when Signal Lab, heatmap and raw candles broadly agree; wait when key data is missing or contradictory.\n")
220 sb.WriteString("- Ranking alone is not an entry reason; it only defines the candidate pool.\n")
221 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")
222 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")
223 sb.WriteString("- Avoid churn: unless stopping out or taking a strong profit, hold new positions for at least 45 minutes; avoid flat/noise closes until roughly 90 minutes; after closing a symbol, wait 90 minutes before re-entry; open at most 1 new position per hour.\n")
224 sb.WriteString("- Stops must sit beyond invalidation; targets should prefer heatmap resistance/liquidation zones or valid risk/reward levels.\n\n")
225 }
226
227 writeModeVariant(&sb, variant, zh)
228
229 altcoinPosValueRatio := riskControl.AltcoinMaxPositionValueRatio
230 if altcoinPosValueRatio <= 0 {
231 altcoinPosValueRatio = 1.0
232 }
233 writeVergexHardConstraints(&sb, accountEquity, riskControl, altcoinPosValueRatio, zh)
234 writeVergexOutputFormat(&sb, accountEquity, riskControl, altcoinPosValueRatio, singleSymbol, primarySymbol, zh)
235
236 customPrompt := englishOnlyPromptSection(e.config.CustomPrompt)
237 if customPrompt != "" {
238 sb.WriteString("# User Preference\n\n")
239 sb.WriteString(customPrompt)
240 sb.WriteString("\n\n")
241 }
242
243 return sb.String()

Callers 1

BuildSystemPromptMethod · 0.95

Calls 6

writeVergexSchemaPromptFunction · 0.85
writeModeVariantFunction · 0.85
writeVergexOutputFormatFunction · 0.85
englishOnlyPromptSectionFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected