feat: Add signalSource field to identify manual vs TradingView trades
- Set signalSource='manual' for Telegram trades, 'tradingview' for TradingView - Updated analytics queries to exclude manual trades from indicator analysis - getTradingStats() filters manual trades (TradingView performance only) - Version comparison endpoint filters manual trades - Created comprehensive filtering guide: docs/MANUAL_TRADE_FILTERING.md - Ensures clean data for indicator optimization without contamination
This commit is contained in:
@@ -143,6 +143,10 @@ export async function getTradingStats(days: number = 30) {
|
||||
createdAt: { gte: since },
|
||||
status: 'closed',
|
||||
isTestTrade: false, // Real trades only
|
||||
OR: [
|
||||
{ signalSource: null }, // Old trades without signalSource
|
||||
{ signalSource: { not: 'manual' } }, // Exclude manual Telegram trades
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user