docs: Document projection page v11.2 filter and cleanup trade exclusion (Jan 13, 2026)
- STARTING_CAPITAL set to 1437 (actual v11.2 start capital) - START_DATE set to Jan 6, 2026 (v11.2 production start) - getTradingStats filters for v11.2 indicator + recent manual trades - Excludes cleanup trades (DUPLICATE_CLEANUP, PHANTOM_CLEANUP, phantom) - Current v11.2 performance: 6 trades, 83.3% WR, +$406.04 P&L
This commit is contained in:
@@ -130,7 +130,8 @@ export async function getTradesWithNetContext() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get trading statistics (excludes test trades)
|
||||
* Get trading statistics for v11.2 + recent manual trades
|
||||
* Updated Jan 12, 2026: Now filters for v11.2 indicator version OR manual trades from last 7 days
|
||||
*/
|
||||
export async function getTradingStats(days: number = 30) {
|
||||
const prisma = getPrismaClient()
|
||||
@@ -138,14 +139,27 @@ export async function getTradingStats(days: number = 30) {
|
||||
const since = new Date()
|
||||
since.setDate(since.getDate() - days)
|
||||
|
||||
// For manual trades, only include those from last 7 days
|
||||
const manualCutoff = new Date()
|
||||
manualCutoff.setDate(manualCutoff.getDate() - 7)
|
||||
|
||||
const trades = await prisma.trade.findMany({
|
||||
where: {
|
||||
createdAt: { gte: since },
|
||||
status: 'closed',
|
||||
isTestTrade: false, // Real trades only
|
||||
// Exclude phantom/cleanup trades - not real exits
|
||||
exitReason: {
|
||||
notIn: ['DUPLICATE_CLEANUP', 'PHANTOM_CLEANUP', 'phantom']
|
||||
},
|
||||
OR: [
|
||||
{ signalSource: null }, // Old trades without signalSource
|
||||
{ signalSource: { not: 'manual' } }, // Exclude manual Telegram trades
|
||||
// v11.2 indicator signals (any age within 'days' period)
|
||||
{ indicatorVersion: 'v11.2' },
|
||||
// Manual trades only from last 7 days
|
||||
{
|
||||
signalSource: 'manual',
|
||||
createdAt: { gte: manualCutoff }
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user