feat: Add missing take profit levels to multi-timeframe analysis

- Display TP1 and TP2 targets in Entry Setup section for each timeframe
- Support both structured take profit format (tp1/tp2) and simple format
- Include proper fallback for different take profit data structures
- Enhanced visual display with emojis and proper formatting
- Now showing complete trading setup: Entry, Stop Loss, and Take Profit levels

Fixes missing take profit display in multi-timeframe analysis view
This commit is contained in:
mindesbunister
2025-07-13 23:22:46 +02:00
parent c9295c40a4
commit f6e9c2eaa7

View File

@@ -534,6 +534,32 @@ export default function AIAnalysisPanel() {
🛑 SL: ${safeRender(timeframeResult.result.analysis.stopLoss.price)}
</div>
)}
{timeframeResult.result.analysis.takeProfits && (
<div className="text-sm text-green-300 mt-1 space-y-1">
{timeframeResult.result.analysis.takeProfits.tp1 && (
<div>
🎯 TP1: ${typeof timeframeResult.result.analysis.takeProfits.tp1.price !== 'undefined'
? safeRender(timeframeResult.result.analysis.takeProfits.tp1.price)
: safeRender(timeframeResult.result.analysis.takeProfits.tp1)}
</div>
)}
{timeframeResult.result.analysis.takeProfits.tp2 && (
<div>
🎯 TP2: ${typeof timeframeResult.result.analysis.takeProfits.tp2.price !== 'undefined'
? safeRender(timeframeResult.result.analysis.takeProfits.tp2.price)
: safeRender(timeframeResult.result.analysis.takeProfits.tp2)}
</div>
)}
{/* Fallback for simple take profit format */}
{!timeframeResult.result.analysis.takeProfits.tp1 && !timeframeResult.result.analysis.takeProfits.tp2 && (
<div>
🎯 TP: {typeof timeframeResult.result.analysis.takeProfits === 'object'
? Object.values(timeframeResult.result.analysis.takeProfits).map((tp: any) => `$${safeRender(tp)}`).join(', ')
: `$${safeRender(timeframeResult.result.analysis.takeProfits)}`}
</div>
)}
</div>
)}
</div>
)}