From 1154cb80cdbeebd6ba2b8dd50c993e15222ec2f6 Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Sat, 26 Jul 2025 11:35:51 +0200 Subject: [PATCH] Fix AI Learning Status to use real data - Remove userId filtering to match ai-analytics behavior - Now shows correct 911 learning records (was 602) - Shows correct 69 trades (was 67) - Displays real 64% win rate instead of subset data - AI Learning Status panel now shows actual trading performance --- lib/ai-learning-status.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/ai-learning-status.ts b/lib/ai-learning-status.ts index 046ea96..4308af9 100644 --- a/lib/ai-learning-status.ts +++ b/lib/ai-learning-status.ts @@ -19,18 +19,13 @@ export interface AILearningStatus { export async function getAILearningStatus(userId: string): Promise { try { - // Get learning data + // Get ALL learning data (not filtered by userId to match ai-analytics behavior) const learningData = await prisma.ai_learning_data.findMany({ - where: { userId }, orderBy: { createdAt: 'desc' } }) - // Get trade data - use real database data instead of demo numbers + // Get ALL trade data (not filtered by userId to match ai-analytics behavior) const trades = await prisma.trades.findMany({ - where: { - userId, - // isAutomated: true // This field might not exist in current schema - }, orderBy: { createdAt: 'desc' } })