feat: make Trade Follow-up Assistant responses concise and actionable

- Updated system prompt to match main analysis style: precision of proprietary desk trader
- Reduced max tokens from 800 to 200 for main responses
- Reduced screenshot analysis tokens from 1000 to 150
- Made welcome messages more compact and focused
- Shortened quick action buttons (Exit now?, Move stop loss, etc.)
- Condensed status report to essential information only
- Eliminated verbose explanations, focus on exact price levels and immediate actions
- Changed temperature from 0.3 to 0.1 for more consistent responses

Addresses user feedback that responses were 'way too vague and too much talk'.
This commit is contained in:
mindesbunister
2025-07-17 16:44:32 +02:00
parent 303c19fe30
commit 39de37e7eb
2 changed files with 32 additions and 36 deletions

View File

@@ -89,18 +89,17 @@ CURRENT POSITION DETAILS:
messages: [
{
role: "system",
content: `You are an expert trading analyst providing real-time trade management advice.
content: `You are a professional trading analyst. Analyze this chart for an active ${position.side} position at $${position.entryPrice}.
CURRENT POSITION: ${positionContext}
Current P&L: ${position.pnl > 0 ? '+' : ''}$${position.pnl?.toFixed(2)}
Analyze the provided chart screenshots and provide specific guidance on:
1. Current market structure and price action
2. Whether to hold, exit, or adjust the position
3. Stop loss and take profit recommendations
4. Risk assessment based on current conditions
5. Key levels to watch
PROVIDE CONCISE ANALYSIS (Max 100 words):
Current price action vs entry
• Key levels to watch
• Risk assessment
• Immediate action needed
Be specific with price levels and actionable advice. Focus on PRACTICAL trade management.`
Be direct. Give exact price levels only.`
},
{
role: "user",
@@ -113,7 +112,7 @@ Be specific with price levels and actionable advice. Focus on PRACTICAL trade ma
]
}
],
max_tokens: 1000,
max_tokens: 150,
temperature: 0.1
})
@@ -123,25 +122,23 @@ Be specific with price levels and actionable advice. Focus on PRACTICAL trade ma
}
// Generate conversational response
const systemPrompt = `You are an expert trading coach helping a trader manage their active position. You have access to:
const systemPrompt = `You are a professional trading coach with the precision of a top proprietary desk trader. No vagueness, no fluff.
CURRENT POSITION:
${positionContext}
${chatContext}
${screenshotAnalysis ? `\nLATEST CHART ANALYSIS:\n${screenshotAnalysis}` : ''}
${screenshotAnalysis ? `LATEST CHART ANALYSIS:\n${screenshotAnalysis}\n` : ''}
GUIDELINES:
- Be conversational and supportive
- Give specific, actionable advice
- Use exact price levels when possible
- Consider risk management principles
- Be honest about market uncertainty
- Use emojis appropriately
- Format important information clearly
RESPONSE STYLE:
- Be direct and actionable
- Give EXACT price levels only
- Use bullet points for clarity
- Maximum 150 words total
- Focus on immediate action needed
The trader is asking: "${message}"
TRADER QUESTION: "${message}"
Provide helpful, specific guidance for their current position.`
Provide concise, specific guidance.`
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
@@ -155,8 +152,8 @@ Provide helpful, specific guidance for their current position.`
content: message
}
],
max_tokens: 800,
temperature: 0.3
max_tokens: 200,
temperature: 0.1
})
const assistantResponse = response.choices[0]?.message?.content