mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 00:07:01 +08:00
feat: add OI ranking data support and fix trader config update issues
- Add OI ranking data fetching and formatting for AI prompts - Fix trader update not saving strategy_id, ai_model_id, initial_balance - Fix AI API key not set for non-qwen/deepseek providers - Add strategy_id to trader config API response - Remove old trader from memory before reloading on update - Clean up unused useTraderActions.ts
This commit is contained in:
@@ -182,7 +182,7 @@ func (e *DebateEngine) runDebate(session *store.DebateSessionWithDetails, strate
|
||||
// Build system prompt based on strategy (same as AI Test)
|
||||
baseSystemPrompt := strategyEngine.BuildSystemPrompt(1000.0, session.PromptVariant)
|
||||
|
||||
// Build user prompt with market data
|
||||
// Build user prompt with market data (OI ranking data is included via ctx.OIRankingData)
|
||||
userPrompt := strategyEngine.BuildUserPrompt(ctx)
|
||||
|
||||
// Run debate rounds
|
||||
@@ -332,6 +332,9 @@ func (e *DebateEngine) buildMarketContext(session *store.DebateSessionWithDetail
|
||||
}
|
||||
quantDataMap := strategyEngine.FetchQuantDataBatch(symbols)
|
||||
|
||||
// Fetch OI ranking data (market-wide position changes)
|
||||
oiRankingData := strategyEngine.FetchOIRankingData()
|
||||
|
||||
// Build context
|
||||
ctx := &decision.Context{
|
||||
CurrentTime: time.Now().UTC().Format("2006-01-02 15:04:05 UTC"),
|
||||
@@ -352,6 +355,7 @@ func (e *DebateEngine) buildMarketContext(session *store.DebateSessionWithDetail
|
||||
PromptVariant: session.PromptVariant,
|
||||
MarketDataMap: marketDataMap,
|
||||
QuantDataMap: quantDataMap,
|
||||
OIRankingData: oiRankingData,
|
||||
}
|
||||
|
||||
return ctx, nil
|
||||
|
||||
Reference in New Issue
Block a user