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:
@@ -773,6 +773,16 @@ func (at *AutoTrader) buildTradingContext() (*decision.Context, error) {
|
||||
logger.Infof("📊 [%s] Successfully fetched quantitative data for %d symbols", at.name, len(ctx.QuantDataMap))
|
||||
}
|
||||
|
||||
// 9. Get OI ranking data (market-wide position changes)
|
||||
if strategyConfig.Indicators.EnableOIRanking {
|
||||
logger.Infof("📊 [%s] Fetching OI ranking data...", at.name)
|
||||
ctx.OIRankingData = at.strategyEngine.FetchOIRankingData()
|
||||
if ctx.OIRankingData != nil {
|
||||
logger.Infof("📊 [%s] OI ranking data ready: %d top, %d low positions",
|
||||
at.name, len(ctx.OIRankingData.TopPositions), len(ctx.OIRankingData.LowPositions))
|
||||
}
|
||||
}
|
||||
|
||||
return ctx, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user