fix: Remove fallback trading data from AI Learning Panel
- Fixed component showing mock data (1120 analyses, 66.7% win rate) instead of real data - Updated fallback logic to show empty/zero values when API fails instead of fake data - Dashboard will now display actual 9,413 analyses and real PATTERN RECOGNITION phase - Removed misleading fallback statistics that showed fake trading performance - Component now properly uses real AI learning API data when available The dashboard should now show the correct learning system status with real data.
This commit is contained in:
@@ -100,25 +100,28 @@ const EnhancedAILearningPanel = () => {
|
||||
|
||||
const aiData = aiLearningData.success ? aiLearningData.data : {
|
||||
// Fallback data when AI learning API is unavailable
|
||||
totalAnalyses: 0,
|
||||
totalDecisions: 0,
|
||||
totalOutcomes: 0,
|
||||
daysActive: 0,
|
||||
avgAccuracy: 0,
|
||||
winRate: 0,
|
||||
confidenceLevel: 0,
|
||||
phase: 'UNKNOWN',
|
||||
nextMilestone: '',
|
||||
recommendation: 'Learning API unavailable',
|
||||
statistics: {
|
||||
totalTrades: 15,
|
||||
wins: 10,
|
||||
losses: 5,
|
||||
winRate: 66.7,
|
||||
totalPnl: 55.66,
|
||||
winsPnl: 56.72,
|
||||
lossesPnl: -1.06,
|
||||
avgWin: 5.67,
|
||||
avgLoss: -0.21,
|
||||
profitFactor: 26.75
|
||||
},
|
||||
totalAnalyses: 1120,
|
||||
avgAccuracy: 79.0,
|
||||
confidenceLevel: 74.8,
|
||||
phase: 'PATTERN RECOGNITION',
|
||||
nextMilestone: 'Reach 65% win rate for advanced level',
|
||||
recommendation: 'AI is learning patterns - maintain conservative position sizes',
|
||||
daysActive: 9
|
||||
totalTrades: 0,
|
||||
wins: 0,
|
||||
losses: 0,
|
||||
winRate: 0,
|
||||
totalPnl: 0,
|
||||
winsPnl: 0,
|
||||
lossesPnl: 0,
|
||||
avgWin: 0,
|
||||
avgLoss: 0,
|
||||
profitFactor: 0
|
||||
}
|
||||
};
|
||||
|
||||
// Merge current status with real AI learning data
|
||||
@@ -183,26 +186,26 @@ const EnhancedAILearningPanel = () => {
|
||||
},
|
||||
automationStatus: null,
|
||||
realTradingData: {
|
||||
// Always provide fallback trading data
|
||||
// Error fallback - show empty data
|
||||
statistics: {
|
||||
totalTrades: 15,
|
||||
wins: 10,
|
||||
losses: 5,
|
||||
winRate: 66.7,
|
||||
totalPnl: 55.66,
|
||||
winsPnl: 56.72,
|
||||
lossesPnl: -1.06,
|
||||
avgWin: 5.67,
|
||||
avgLoss: -0.21,
|
||||
profitFactor: 26.75
|
||||
totalTrades: 0,
|
||||
wins: 0,
|
||||
losses: 0,
|
||||
winRate: 0,
|
||||
totalPnl: 0,
|
||||
winsPnl: 0,
|
||||
lossesPnl: 0,
|
||||
avgWin: 0,
|
||||
avgLoss: 0,
|
||||
profitFactor: 0
|
||||
},
|
||||
totalAnalyses: 1120,
|
||||
avgAccuracy: 79.0,
|
||||
confidenceLevel: 74.8,
|
||||
phase: 'PATTERN RECOGNITION',
|
||||
nextMilestone: 'Reach 65% win rate for advanced level',
|
||||
recommendation: 'AI is learning patterns - maintain conservative position sizes',
|
||||
daysActive: 9
|
||||
totalAnalyses: 0,
|
||||
avgAccuracy: 0,
|
||||
confidenceLevel: 0,
|
||||
phase: 'ERROR',
|
||||
nextMilestone: 'Fix API connection',
|
||||
recommendation: 'Learning system API unavailable',
|
||||
daysActive: 0
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user