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

Method createDefaultStrategies

api/handler_user.go:223–367  ·  view source on GitHub ↗
(userID string, lang string)

Source from the content-addressed store, hash-verified

221}
222
223func (s *Server) createDefaultStrategies(userID string, lang string) error {
224 type strategyI18n struct {
225 name, description string
226 }
227 type strategyLocale struct {
228 defaultStrategy strategyI18n
229 }
230 locales := map[string]strategyLocale{
231 "zh": {
232 defaultStrategy: strategyI18n{"NOFX Claw402 Auto Strategy", "The only built-in strategy: read the Claw402.ai board each cycle, fetch Signal Lab and cost/liquidation heatmap per candidate, then decide with raw candles."},
233 },
234 "en": {
235 defaultStrategy: strategyI18n{"NOFX Claw402 Auto Strategy", "The only built-in strategy: read the Claw402.ai board each cycle, fetch Signal Lab and cost/liquidation heatmap per candidate, then decide with raw candles."},
236 },
237 "id": {
238 defaultStrategy: strategyI18n{"Strategi Otomatis NOFX Claw402", "Satu strategi bawaan: membaca papan Claw402.ai, mengambil Signal Lab dan heatmap biaya/likuidasi per kandidat, lalu memutuskan dengan candle mentah."},
239 },
240 }
241 locale, ok := locales[lang]
242 if !ok {
243 locale = locales["en"]
244 }
245
246 type strategyDef struct {
247 name string
248 description string
249 isActive bool
250 applyConfig func(*store.StrategyConfig)
251 }
252
253 setClaw402Strategy := func(c *store.StrategyConfig) {
254 c.CoinSource.SourceType = "vergex_signal"
255 c.CoinSource.StaticCoins = nil
256 c.CoinSource.UseAI500 = false
257 c.CoinSource.UseOITop = false
258 c.CoinSource.UseOILow = false
259 c.CoinSource.UseHyperAll = false
260 c.CoinSource.UseHyperMain = false
261 c.CoinSource.HyperRankCategory = "all"
262 c.CoinSource.VergexLimit = 10
263 c.CoinSource.VergexMarketType = "all"
264 c.CoinSource.VergexChain = "hyperliquid"
265 c.RiskControl.MaxPositions = 2
266 c.RiskControl.BTCETHMaxLeverage = 10
267 c.RiskControl.AltcoinMaxLeverage = 10
268 c.RiskControl.BTCETHMaxPositionValueRatio = 10.0
269 c.RiskControl.AltcoinMaxPositionValueRatio = 10.0
270 c.RiskControl.MaxMarginUsage = 1.0
271 c.RiskControl.MinConfidence = 78
272 c.RiskControl.MinRiskRewardRatio = 3.0
273 c.Indicators.Klines.PrimaryTimeframe = "15m"
274 c.Indicators.Klines.PrimaryCount = 30
275 c.Indicators.Klines.LongerTimeframe = ""
276 c.Indicators.Klines.LongerCount = 0
277 c.Indicators.Klines.EnableMultiTimeframe = false
278 c.Indicators.Klines.SelectedTimeframes = []string{"15m"}
279 c.Indicators.EnableRawKlines = true
280 }

Calls 10

SetConfigMethod · 0.95
GetDefaultStrategyConfigFunction · 0.92
InfofFunction · 0.92
ClampLimitsMethod · 0.80
TransactionMethod · 0.80
CountMethod · 0.80
ErrorfMethod · 0.65
StringMethod · 0.45
DeleteMethod · 0.45
CreateMethod · 0.45