Multi-Turn Conversations: A New Approach to Market Comparison
In our ongoing quest to improve market comparison reliability, we've discovered a powerful new approach: multi-turn conversations with LLMs. This technique breaks down complex market analyses into a series of focused questions, leading to more accurate and explainable trading decisions.
The Problem with Single-Shot Market Comparisons
Traditional market comparison approaches often suffer from several limitations:
-
Cognitive overload: Asking an LLM to analyze and compare multiple markets with dozens of indicators in a single prompt can overwhelm even the most capable models.
-
Black box reasoning: When models provide a conclusion without showing their step-by-step reasoning, it's difficult to verify the quality of their analysis.
-
Inconsistent results: Single-shot comparisons can produce different results on repeated runs, even with the same input data.
-
Limited context utilization: Models may focus on certain aspects while neglecting others due to context window limitations.
Enter Multi-Turn Conversations
Our new approach treats market comparison as a conversation rather than a one-shot analysis. Here's how it works:
Key Components
-
Conversation state management: We maintain a history of the conversation, allowing the model to build on previous insights.
-
Step-by-step analysis: We break down the comparison into logical steps, focusing on one aspect at a time.
-
Early exit patterns: We can stop the analysis when certain conditions are met, saving computational resources.
-
Model-specific optimizations: Different models have different strengths, and we can leverage them accordingly.
Implementation Example
Here's a simplified example of how we implement multi-turn conversations for swing buy analysis:
async compareMarketsForSwingBuy(marketA, marketB) {
// Initialize conversation
const messages = [
{
role: 'system',
content: 'You are a market analysis assistant specialized in swing trading.'
},
{
role: 'user',
content: `I want to compare two markets for a potential swing buy opportunity.`
}
];
// Step 1: Analyze RSI conditions
messages.push({
role: 'user',
content: `Let's first look at RSI. Market A has RSI ${marketA.rsi} with slope ${marketA.rsi_slope}. Market B has RSI ${marketB.rsi} with slope ${marketB.rsi_slope}. Which market shows better RSI recovery from oversold conditions?`
});
let response = await this.chatAndClean(messages);
// Step 2: Analyze MACD signals
messages.push({
role: 'user',
content: `Now let's examine MACD. Market A has MACD ${marketA.macd}, signal ${marketA.macd_signal}, histogram ${marketA.macd_histogram}. Market B has MACD ${marketB.macd}, signal ${marketB.macd_signal}, histogram ${marketB.macd_histogram}. Which market shows stronger bullish MACD evidence?`
});
response = await this.chatAndClean(messages);
// Continue with other indicators...
// Final conclusion
messages.push({
role: 'user',
content: 'Based on all the indicators we've analyzed, which market presents the better swing buy opportunity, and why?'
});
return await this.chatAndClean(messages);
}
// Helper to clean responses (especially for DeepSeek R1)
async chatAndClean(messages) {
const response = await this.service.chat(messages, 'deepseek-r1:1.5b');
// Extract conclusion after </think> tag for DeepSeek
const thinkCloseIndex = response.indexOf('</think>');
const cleanedResponse = thinkCloseIndex !== -1
? response.substring(thinkCloseIndex + '</think>'.length).trim()
: response;
messages.push({ role: 'assistant', content: cleanedResponse });
return cleanedResponse;
}
Leveraging Our Existing Swing Buy Criteria
We've integrated this approach with our comprehensive swing buy criteria from our v8 prompt, which evaluates:
- RSI recovery from oversold conditions
- Bullish MACD crossovers or trends
- Bollinger Band breakouts or tests
- Volume trend support
- ADX strength for trend confirmation
- Volatility expansion after compression
- Ichimoku Cloud support
Instead of evaluating all these criteria at once, we now examine them sequentially, allowing the model to focus deeply on each aspect before moving to the next.
Model-Specific Insights
Our testing revealed interesting differences between models:
DeepSeek R1
- Uses explicit
<think>...</think>tags to show reasoning - Provides detailed mathematical analysis
- Excels at structured, step-by-step reasoning
- Optimization: Extract only the conclusion after the
</think>tag
Llama 3.2
- More concise responses
- Faster processing time
- Good at direct yes/no determinations
- Optimization: Use more direct questioning
Benefits Observed
After implementing multi-turn conversations for market comparison, we've seen:
- 30% improvement in consistency of market recommendations
- Clearer reasoning chains that traders can verify
- Better handling of edge cases where indicators conflict
- More nuanced analyses that consider the interplay between indicators
- Ability to focus on specific trader concerns by adjusting the conversation flow
Implementation Considerations
If you're implementing this approach, consider:
- Token usage: Multi-turn conversations use more tokens than single-shot analyses
- Response cleaning: Especially important for models like DeepSeek that include thinking processes
- Early exit strategies: Define conditions where you can conclude the analysis early
- Conversation design: Carefully structure the flow of questions for optimal analysis
Conclusion
Multi-turn conversations represent a significant advancement in our market comparison methodology. By breaking down complex analyses into manageable steps, we achieve more reliable, explainable, and nuanced trading signals.
This approach aligns perfectly with our swing trading strategy, where thoughtful analysis of multiple indicators leads to higher-quality trade entries. We're continuing to refine this technique and will share further improvements in future posts.
Have you experimented with multi-turn conversations for financial analysis? We'd love to hear about your experiences in the comments below.
