fix: add MAE/MFE fields to all ActiveTrade initializations

Updated execute, test, and test-db endpoints to include:
- maxFavorableExcursion: 0
- maxAdverseExcursion: 0
- maxFavorablePrice: entryPrice
- maxAdversePrice: entryPrice

Required for TypeScript compilation after adding MAE/MFE tracking
This commit is contained in:
mindesbunister
2025-11-02 23:04:02 +01:00
parent ee7558b47c
commit d4aeeb4f99
3 changed files with 12 additions and 0 deletions

View File

@@ -246,6 +246,10 @@ export async function POST(request: NextRequest): Promise<NextResponse<ExecuteTr
unrealizedPnL: 0,
peakPnL: 0,
peakPrice: entryPrice,
maxFavorableExcursion: 0,
maxAdverseExcursion: 0,
maxFavorablePrice: entryPrice,
maxAdversePrice: entryPrice,
priceCheckCount: 0,
lastPrice: entryPrice,
lastUpdateTime: Date.now(),

View File

@@ -179,6 +179,10 @@ export async function POST(request: NextRequest): Promise<NextResponse<TestTrade
unrealizedPnL: 0,
peakPnL: 0,
peakPrice: entryPrice,
maxFavorableExcursion: 0,
maxAdverseExcursion: 0,
maxFavorablePrice: entryPrice,
maxAdversePrice: entryPrice,
priceCheckCount: 0,
lastPrice: entryPrice,
lastUpdateTime: Date.now(),

View File

@@ -185,6 +185,10 @@ export async function POST(request: NextRequest): Promise<NextResponse<TestTrade
unrealizedPnL: 0,
peakPnL: 0,
peakPrice: entryPrice,
maxFavorableExcursion: 0,
maxAdverseExcursion: 0,
maxFavorablePrice: entryPrice,
maxAdversePrice: entryPrice,
priceCheckCount: 0,
lastPrice: entryPrice,
lastUpdateTime: Date.now(),