Enhance AI analysis with professional trading assistant approach
- Updated AI prompts to behave like professional proprietary desk trader - Enhanced take profit display with RSI/OBV expectations and detailed descriptions - Added timeframe risk assessment with leverage recommendations - Implemented comprehensive indicator analysis (RSI, VWAP, OBV, MACD) - Added alternatives section with tighter stops and scaled entry options - Enhanced test script output for better trade setup visualization - Improved confirmation triggers with specific technical signals - Added cross-layout consensus analysis for multi-screenshot comparison - Cost-effective analysis using gpt-4o mini (~/usr/bin/bash.006 per analysis)
This commit is contained in:
@@ -29,8 +29,18 @@ export interface AnalysisResult {
|
|||||||
rationale: string
|
rationale: string
|
||||||
}
|
}
|
||||||
takeProfits?: {
|
takeProfits?: {
|
||||||
tp1?: { price: number; description: string }
|
tp1?: {
|
||||||
tp2?: { price: number; description: string }
|
price: number
|
||||||
|
description: string
|
||||||
|
rsiExpectation?: string
|
||||||
|
obvExpectation?: string
|
||||||
|
}
|
||||||
|
tp2?: {
|
||||||
|
price: number
|
||||||
|
description: string
|
||||||
|
rsiExpectation?: string
|
||||||
|
obvExpectation?: string
|
||||||
|
}
|
||||||
}
|
}
|
||||||
riskToReward?: string
|
riskToReward?: string
|
||||||
confirmationTrigger?: string
|
confirmationTrigger?: string
|
||||||
@@ -38,6 +48,24 @@ export interface AnalysisResult {
|
|||||||
rsi?: string
|
rsi?: string
|
||||||
vwap?: string
|
vwap?: string
|
||||||
obv?: string
|
obv?: string
|
||||||
|
macd?: string
|
||||||
|
crossLayoutConsensus?: string
|
||||||
|
}
|
||||||
|
layoutComparison?: {
|
||||||
|
aiLayout?: string
|
||||||
|
diyLayout?: string
|
||||||
|
consensus?: string
|
||||||
|
divergences?: string
|
||||||
|
}
|
||||||
|
timeframeRisk?: {
|
||||||
|
assessment?: string
|
||||||
|
positionSize?: string
|
||||||
|
leverageRecommendation?: string
|
||||||
|
}
|
||||||
|
alternatives?: {
|
||||||
|
tigherStopOption?: string
|
||||||
|
scaledEntry?: string
|
||||||
|
invalidationScenario?: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +78,35 @@ export class AIAnalysisService {
|
|||||||
const imageBuffer = await fs.readFile(imagePath)
|
const imageBuffer = await fs.readFile(imagePath)
|
||||||
const base64Image = imageBuffer.toString('base64')
|
const base64Image = imageBuffer.toString('base64')
|
||||||
|
|
||||||
const prompt = `You are a technical chart analysis expert. Please analyze this TradingView chart image and provide objective technical analysis data.
|
const prompt = `You are now a professional trading assistant. You behave with the precision and decisiveness of a top proprietary desk trader. No vagueness, no fluff.
|
||||||
|
|
||||||
**Important**: This is for educational and research purposes only. Please analyze the technical indicators, price levels, and chart patterns visible in the image.
|
**TRADING ANALYSIS REQUIREMENTS:**
|
||||||
|
|
||||||
|
1. **TIMEFRAME RISK ASSESSMENT**: Based on the timeframe shown in the screenshot, adjust risk accordingly:
|
||||||
|
- Lower timeframes (1m-15m): Higher risk, use at least 10x leverage for scalps, smaller position sizes
|
||||||
|
- Higher timeframes (4H+): Lower risk, larger position sizes, swing trades
|
||||||
|
- 5-minute scalps require at least 10x leverage
|
||||||
|
|
||||||
|
2. **BE 100% SPECIFIC** - Provide exact levels with clear rationale:
|
||||||
|
|
||||||
|
**ENTRY**: Exact price level (with ± buffer if needed)
|
||||||
|
- Rationale: e.g., "Rejection from 15 EMA + VWAP confluence near intraday supply"
|
||||||
|
|
||||||
|
**STOP-LOSS**: Exact level (not arbitrary)
|
||||||
|
- Explain WHY it's there: "Above VWAP + failed breakout zone"
|
||||||
|
|
||||||
|
**TAKE PROFITS**:
|
||||||
|
- TP1: Immediate structure (previous low/high, key level)
|
||||||
|
- TP2: Extended target if momentum continues
|
||||||
|
- Mention expected RSI/OBV behavior at each TP zone
|
||||||
|
|
||||||
|
3. **RISK-TO-REWARD**: Show R:R ratio with dollar amounts if possible
|
||||||
|
|
||||||
|
4. **CONFIRMATION TRIGGERS**: Exact signals to wait for:
|
||||||
|
- Specific candle patterns, indicator crosses, volume confirmations
|
||||||
|
- RSI behavior: "If RSI crosses above 70 while price is under resistance → wait"
|
||||||
|
- VWAP: "If price retakes VWAP with bullish momentum → consider invalidation"
|
||||||
|
- OBV: "If OBV starts climbing while price stays flat → early exit or reconsider bias"
|
||||||
|
|
||||||
Examine the chart and identify:
|
Examine the chart and identify:
|
||||||
- Current price action and trend direction
|
- Current price action and trend direction
|
||||||
@@ -64,7 +118,7 @@ Examine the chart and identify:
|
|||||||
Provide your analysis in this exact JSON format (replace values with your analysis):
|
Provide your analysis in this exact JSON format (replace values with your analysis):
|
||||||
|
|
||||||
{
|
{
|
||||||
"summary": "Objective description of what you observe in the chart",
|
"summary": "Objective technical analysis with timeframe risk assessment and specific trading setup",
|
||||||
"marketSentiment": "BULLISH|BEARISH|NEUTRAL",
|
"marketSentiment": "BULLISH|BEARISH|NEUTRAL",
|
||||||
"keyLevels": {
|
"keyLevels": {
|
||||||
"support": [list of visible support price levels as numbers],
|
"support": [list of visible support price levels as numbers],
|
||||||
@@ -72,26 +126,47 @@ Provide your analysis in this exact JSON format (replace values with your analys
|
|||||||
},
|
},
|
||||||
"recommendation": "BUY|SELL|HOLD",
|
"recommendation": "BUY|SELL|HOLD",
|
||||||
"confidence": 75,
|
"confidence": 75,
|
||||||
"reasoning": "Technical analysis reasoning based on indicators and price action",
|
"reasoning": "Specific technical analysis reasoning with exact rationale for each level",
|
||||||
"entry": {
|
"entry": {
|
||||||
"price": 150.50,
|
"price": 150.50,
|
||||||
"buffer": "±0.25",
|
"buffer": "±0.25",
|
||||||
"rationale": "Technical reasoning for entry level"
|
"rationale": "Specific technical reasoning: rejection from 15 EMA + VWAP confluence near intraday supply"
|
||||||
},
|
},
|
||||||
"stopLoss": {
|
"stopLoss": {
|
||||||
"price": 148.00,
|
"price": 148.00,
|
||||||
"rationale": "Technical reasoning for stop level"
|
"rationale": "Exact reasoning: Above VWAP + failed breakout zone"
|
||||||
},
|
},
|
||||||
"takeProfits": {
|
"takeProfits": {
|
||||||
"tp1": { "price": 152.00, "description": "First target reasoning" },
|
"tp1": {
|
||||||
"tp2": { "price": 154.00, "description": "Second target reasoning" }
|
"price": 152.00,
|
||||||
|
"description": "Immediate structure target with indicator expectations",
|
||||||
|
"rsiExpectation": "RSI should reach 60-65 zone",
|
||||||
|
"obvExpectation": "OBV confirming momentum"
|
||||||
|
},
|
||||||
|
"tp2": {
|
||||||
|
"price": 154.00,
|
||||||
|
"description": "Extended target if momentum continues",
|
||||||
|
"rsiExpectation": "RSI approaching 70+ overbought",
|
||||||
|
"obvExpectation": "OBV making new highs with price"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"riskToReward": "1:2",
|
"riskToReward": "1:2",
|
||||||
"confirmationTrigger": "Technical signal to watch for",
|
"confirmationTrigger": "Specific signal: Bearish engulfing candle on rejection from VWAP zone with RSI under 50",
|
||||||
"indicatorAnalysis": {
|
"indicatorAnalysis": {
|
||||||
"rsi": "RSI level and interpretation",
|
"rsi": "Specific RSI level and precise interpretation with action triggers",
|
||||||
"vwap": "VWAP relationship to price",
|
"vwap": "VWAP relationship to price with exact invalidation levels",
|
||||||
"obv": "Volume analysis if visible"
|
"obv": "Volume analysis with specific behavioral expectations",
|
||||||
|
"macd": "MACD signal line crosses and momentum analysis"
|
||||||
|
},
|
||||||
|
"timeframeRisk": {
|
||||||
|
"assessment": "Risk level based on detected timeframe",
|
||||||
|
"positionSize": "Suggested position sizing based on timeframe",
|
||||||
|
"leverageRecommendation": "Specific leverage suggestion for the timeframe"
|
||||||
|
},
|
||||||
|
"alternatives": {
|
||||||
|
"tigherStopOption": "Alternative setup with tighter stop if original SL is too far",
|
||||||
|
"scaledEntry": "Scaled entry approach if better levels become available",
|
||||||
|
"invalidationScenario": "What price action would invalidate this setup completely"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,35 +271,49 @@ Return only the JSON object with your technical analysis.`
|
|||||||
return 'Unknown Layout'
|
return 'Unknown Layout'
|
||||||
}).join(' and ')
|
}).join(' and ')
|
||||||
|
|
||||||
const prompt = `You are a professional technical chart analysis expert. I'm providing you with ${filenames.length} TradingView chart screenshots from different layouts: ${layoutInfo}.
|
const prompt = `You are now a professional trading assistant. You behave with the precision and decisiveness of a top proprietary desk trader. No vagueness, no fluff.
|
||||||
|
|
||||||
**IMPORTANT**: Please analyze ALL screenshots together to provide comprehensive trading advice. Compare the different layouts and use ALL available information to make the most informed recommendation.
|
I'm providing you with ${filenames.length} TradingView chart screenshots from different layouts: ${layoutInfo}.
|
||||||
|
|
||||||
**Analysis Requirements:**
|
**TRADING ANALYSIS REQUIREMENTS:**
|
||||||
1. Examine ALL charts for:
|
|
||||||
- Current price action and trend direction across all timeframes/layouts
|
|
||||||
- Key support and resistance levels visible in any chart
|
|
||||||
- Technical indicator readings (RSI, moving averages, volume, etc.)
|
|
||||||
- Chart patterns or formations
|
|
||||||
- Market structure elements
|
|
||||||
- Any divergences or confirmations between the layouts
|
|
||||||
|
|
||||||
2. **Cross-Layout Analysis**:
|
1. **TIMEFRAME RISK ASSESSMENT**: Based on the timeframe shown in the screenshots, adjust risk accordingly:
|
||||||
- Compare insights from different chart layouts
|
- Lower timeframes (1m-15m): Higher risk, use at least 10x leverage for scalps, smaller position sizes
|
||||||
- Look for confirmations or contradictions between views
|
- Higher timeframes (4H+): Lower risk, larger position sizes, swing trades
|
||||||
- Identify which layout provides the clearest signals
|
- 5-minute scalps require at least 10x leverage
|
||||||
|
|
||||||
|
2. **BE 100% SPECIFIC** - Provide exact levels with clear rationale:
|
||||||
|
|
||||||
|
**ENTRY**: Exact price level (with ± buffer if needed)
|
||||||
|
- Rationale: e.g., "Rejection from 15 EMA + VWAP confluence near intraday supply"
|
||||||
|
|
||||||
|
**STOP-LOSS**: Exact level (not arbitrary)
|
||||||
|
- Explain WHY it's there: "Above VWAP + failed breakout zone"
|
||||||
|
|
||||||
|
**TAKE PROFITS**:
|
||||||
|
- TP1: Immediate structure (previous low/high, key level)
|
||||||
|
- TP2: Extended target if momentum continues
|
||||||
|
- Mention expected RSI/OBV behavior at each TP zone
|
||||||
|
|
||||||
|
3. **RISK-TO-REWARD**: Show R:R ratio with dollar amounts if possible
|
||||||
|
|
||||||
|
4. **CONFIRMATION TRIGGERS**: Exact signals to wait for:
|
||||||
|
- Specific candle patterns, indicator crosses, volume confirmations
|
||||||
|
- RSI behavior: "If RSI crosses above 70 while price is under resistance → wait"
|
||||||
|
- VWAP: "If price retakes VWAP with bullish momentum → consider invalidation"
|
||||||
|
- OBV: "If OBV starts climbing while price stays flat → early exit or reconsider bias"
|
||||||
|
|
||||||
|
5. **CROSS-LAYOUT ANALYSIS**:
|
||||||
|
- Compare insights from different chart layouts for confirmations/contradictions
|
||||||
- Use multiple perspectives to increase confidence
|
- Use multiple perspectives to increase confidence
|
||||||
|
- Note which layout provides clearest signals
|
||||||
|
|
||||||
3. **Comprehensive Trading Setup**:
|
6. **ALTERNATIVES**: If SL is far, offer tighter alternatives or scaled entries
|
||||||
- Provide entry, stop loss, and take profit levels
|
|
||||||
- Include risk-to-reward analysis
|
|
||||||
- Suggest confirmation triggers
|
|
||||||
- Rate your confidence based on multi-layout consensus
|
|
||||||
|
|
||||||
**Response Format** (return only valid JSON):
|
**Response Format** (return only valid JSON):
|
||||||
|
|
||||||
{
|
{
|
||||||
"summary": "Comprehensive analysis of all charts including cross-layout insights and consensus",
|
"summary": "Comprehensive multi-layout analysis with timeframe risk assessment and cross-layout insights",
|
||||||
"marketSentiment": "BULLISH|BEARISH|NEUTRAL",
|
"marketSentiment": "BULLISH|BEARISH|NEUTRAL",
|
||||||
"keyLevels": {
|
"keyLevels": {
|
||||||
"support": [array of support levels from all charts],
|
"support": [array of support levels from all charts],
|
||||||
@@ -232,33 +321,54 @@ Return only the JSON object with your technical analysis.`
|
|||||||
},
|
},
|
||||||
"recommendation": "BUY|SELL|HOLD",
|
"recommendation": "BUY|SELL|HOLD",
|
||||||
"confidence": 85,
|
"confidence": 85,
|
||||||
"reasoning": "Multi-layout technical analysis reasoning explaining how different charts confirm or contradict each other",
|
"reasoning": "Multi-layout technical analysis with specific rationale for each level and timeframe-adjusted risk assessment",
|
||||||
"entry": {
|
"entry": {
|
||||||
"price": 150.50,
|
"price": 150.50,
|
||||||
"buffer": "±0.25",
|
"buffer": "±0.25",
|
||||||
"rationale": "Entry reasoning based on multiple chart analysis"
|
"rationale": "Specific technical reasoning: rejection from 15 EMA + VWAP confluence near intraday supply"
|
||||||
},
|
},
|
||||||
"stopLoss": {
|
"stopLoss": {
|
||||||
"price": 148.00,
|
"price": 148.00,
|
||||||
"rationale": "Stop loss reasoning considering all layouts"
|
"rationale": "Exact reasoning: Above VWAP + failed breakout zone"
|
||||||
},
|
},
|
||||||
"takeProfits": {
|
"takeProfits": {
|
||||||
"tp1": { "price": 152.00, "description": "First target based on multi-chart analysis" },
|
"tp1": {
|
||||||
"tp2": { "price": 154.00, "description": "Second target with cross-layout confirmation" }
|
"price": 152.00,
|
||||||
|
"description": "Immediate structure target with RSI/OBV expectations",
|
||||||
|
"rsiExpectation": "RSI should reach 60-65 zone",
|
||||||
|
"obvExpectation": "OBV confirming momentum"
|
||||||
|
},
|
||||||
|
"tp2": {
|
||||||
|
"price": 154.00,
|
||||||
|
"description": "Extended target if momentum continues",
|
||||||
|
"rsiExpectation": "RSI approaching 70+ overbought",
|
||||||
|
"obvExpectation": "OBV making new highs with price"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"riskToReward": "1:2.5",
|
"riskToReward": "1:2.5",
|
||||||
"confirmationTrigger": "Multi-layout signal confirmation to watch for",
|
"confirmationTrigger": "Specific signal: Bearish engulfing candle on rejection from VWAP zone with RSI under 50",
|
||||||
"indicatorAnalysis": {
|
"indicatorAnalysis": {
|
||||||
"rsi": "RSI analysis across layouts",
|
"rsi": "Specific RSI level and precise interpretation with action triggers",
|
||||||
"vwap": "VWAP analysis from multiple views",
|
"vwap": "VWAP relationship to price with exact invalidation levels",
|
||||||
"obv": "Volume analysis synthesis",
|
"obv": "Volume analysis with specific behavioral expectations",
|
||||||
"crossLayoutConsensus": "How well different layouts agree on the signals"
|
"macd": "MACD signal line crosses and momentum analysis",
|
||||||
|
"crossLayoutConsensus": "Detailed comparison of how different layouts confirm or contradict signals"
|
||||||
},
|
},
|
||||||
"layoutComparison": {
|
"layoutComparison": {
|
||||||
"aiLayout": "Insights specific to AI layout",
|
"aiLayout": "Specific insights and edge from AI layout analysis",
|
||||||
"diyLayout": "Insights specific to DIY module layout",
|
"diyLayout": "Specific insights and edge from DIY module layout analysis",
|
||||||
"consensus": "Areas where both layouts agree",
|
"consensus": "Exact areas where both layouts strongly agree with confidence boost",
|
||||||
"divergences": "Areas where layouts show different signals"
|
"divergences": "Specific contradictions between layouts and how to resolve them"
|
||||||
|
},
|
||||||
|
"timeframeRisk": {
|
||||||
|
"assessment": "Risk level based on detected timeframe",
|
||||||
|
"positionSize": "Suggested position sizing based on timeframe",
|
||||||
|
"leverageRecommendation": "Specific leverage suggestion for the timeframe"
|
||||||
|
},
|
||||||
|
"alternatives": {
|
||||||
|
"tigherStopOption": "Alternative setup with tighter stop if original SL is too far",
|
||||||
|
"scaledEntry": "Scaled entry approach if better levels become available",
|
||||||
|
"invalidationScenario": "What price action would invalidate this setup completely"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,18 +78,129 @@ async function testDualSessionScreenshots() {
|
|||||||
console.log(` 📊 Market Sentiment: ${result.analysis.marketSentiment}`)
|
console.log(` 📊 Market Sentiment: ${result.analysis.marketSentiment}`)
|
||||||
console.log(` 📈 Recommendation: ${result.analysis.recommendation}`)
|
console.log(` 📈 Recommendation: ${result.analysis.recommendation}`)
|
||||||
console.log(` 🎯 Confidence: ${result.analysis.confidence}%`)
|
console.log(` 🎯 Confidence: ${result.analysis.confidence}%`)
|
||||||
|
|
||||||
|
// Trading Setup Section
|
||||||
if (result.analysis.entry) {
|
if (result.analysis.entry) {
|
||||||
console.log(` 💰 Entry: $${result.analysis.entry.price}`)
|
console.log('\n💰 TRADING SETUP:')
|
||||||
|
console.log(` <20> Entry: $${result.analysis.entry.price}${result.analysis.entry.buffer ? ' ' + result.analysis.entry.buffer : ''}`)
|
||||||
|
if (result.analysis.entry.rationale) {
|
||||||
|
console.log(` 💡 ${result.analysis.entry.rationale}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.analysis.stopLoss) {
|
||||||
|
console.log(` 🛑 Stop Loss: $${result.analysis.stopLoss.price}`)
|
||||||
|
if (result.analysis.stopLoss.rationale) {
|
||||||
|
console.log(` 💡 ${result.analysis.stopLoss.rationale}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enhanced Take Profit Display
|
||||||
|
if (result.analysis.takeProfits) {
|
||||||
|
console.log('\n🎯 TAKE PROFIT TARGETS:')
|
||||||
|
if (result.analysis.takeProfits.tp1) {
|
||||||
|
const tp1 = result.analysis.takeProfits.tp1
|
||||||
|
console.log(` 🥉 TP1: $${tp1.price}`)
|
||||||
|
console.log(` 📋 ${tp1.description}`)
|
||||||
|
if (tp1.rsiExpectation) {
|
||||||
|
console.log(` 📊 RSI: ${tp1.rsiExpectation}`)
|
||||||
|
}
|
||||||
|
if (tp1.obvExpectation) {
|
||||||
|
console.log(` 📈 OBV: ${tp1.obvExpectation}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (result.analysis.takeProfits.tp2) {
|
||||||
|
const tp2 = result.analysis.takeProfits.tp2
|
||||||
|
console.log(` 🥈 TP2: $${tp2.price}`)
|
||||||
|
console.log(` 📋 ${tp2.description}`)
|
||||||
|
if (tp2.rsiExpectation) {
|
||||||
|
console.log(` 📊 RSI: ${tp2.rsiExpectation}`)
|
||||||
|
}
|
||||||
|
if (tp2.obvExpectation) {
|
||||||
|
console.log(` 📈 OBV: ${tp2.obvExpectation}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.analysis.riskToReward) {
|
||||||
|
console.log(`\n⚖️ Risk/Reward: ${result.analysis.riskToReward}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.analysis.confirmationTrigger) {
|
||||||
|
console.log(`\n🔔 Confirmation Trigger: ${result.analysis.confirmationTrigger}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Timeframe Risk Assessment
|
||||||
|
if (result.analysis.timeframeRisk) {
|
||||||
|
console.log('\n⏰ TIMEFRAME RISK ASSESSMENT:')
|
||||||
|
if (result.analysis.timeframeRisk.assessment) {
|
||||||
|
console.log(` 📊 Risk Level: ${result.analysis.timeframeRisk.assessment}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.timeframeRisk.positionSize) {
|
||||||
|
console.log(` <20> Position Size: ${result.analysis.timeframeRisk.positionSize}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.timeframeRisk.leverageRecommendation) {
|
||||||
|
console.log(` 🎚️ Leverage: ${result.analysis.timeframeRisk.leverageRecommendation}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Key Levels
|
||||||
if (result.analysis.keyLevels) {
|
if (result.analysis.keyLevels) {
|
||||||
console.log(` 🔴 Resistance: ${result.analysis.keyLevels.resistance?.join(', ') || 'None'}`)
|
console.log('\n📊 KEY LEVELS:')
|
||||||
console.log(` 🟢 Support: ${result.analysis.keyLevels.support?.join(', ') || 'None'}`)
|
if (result.analysis.keyLevels.resistance?.length > 0) {
|
||||||
|
console.log(` <20>🔴 Resistance: ${result.analysis.keyLevels.resistance.map(r => `$${r}`).join(', ')}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.keyLevels.support?.length > 0) {
|
||||||
|
console.log(` 🟢 Support: ${result.analysis.keyLevels.support.map(s => `$${s}`).join(', ')}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Indicator Analysis
|
||||||
|
if (result.analysis.indicatorAnalysis) {
|
||||||
|
console.log('\n📈 TECHNICAL INDICATORS:')
|
||||||
|
if (result.analysis.indicatorAnalysis.rsi) {
|
||||||
|
console.log(` 📊 RSI: ${result.analysis.indicatorAnalysis.rsi}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.indicatorAnalysis.vwap) {
|
||||||
|
console.log(` 📈 VWAP: ${result.analysis.indicatorAnalysis.vwap}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.indicatorAnalysis.obv) {
|
||||||
|
console.log(` 📊 OBV: ${result.analysis.indicatorAnalysis.obv}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.indicatorAnalysis.macd) {
|
||||||
|
console.log(` 📉 MACD: ${result.analysis.indicatorAnalysis.macd}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Layout Comparison
|
||||||
if (result.analysis.layoutComparison) {
|
if (result.analysis.layoutComparison) {
|
||||||
console.log('\n🔄 Layout Comparison:')
|
console.log('\n🔄 LAYOUT COMPARISON:')
|
||||||
console.log(` 📊 AI Layout: ${result.analysis.layoutComparison.aiLayout}`)
|
if (result.analysis.layoutComparison.aiLayout) {
|
||||||
console.log(` 🔧 DIY Layout: ${result.analysis.layoutComparison.diyLayout}`)
|
console.log(` 🤖 AI Layout: ${result.analysis.layoutComparison.aiLayout}`)
|
||||||
console.log(` ✅ Consensus: ${result.analysis.layoutComparison.consensus}`)
|
}
|
||||||
|
if (result.analysis.layoutComparison.diyLayout) {
|
||||||
|
console.log(` 🔧 DIY Layout: ${result.analysis.layoutComparison.diyLayout}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.layoutComparison.consensus) {
|
||||||
|
console.log(` ✅ Consensus: ${result.analysis.layoutComparison.consensus}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.layoutComparison.divergences) {
|
||||||
|
console.log(` ⚠️ Divergences: ${result.analysis.layoutComparison.divergences}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alternatives
|
||||||
|
if (result.analysis.alternatives) {
|
||||||
|
console.log('\n🔄 ALTERNATIVES:')
|
||||||
|
if (result.analysis.alternatives.tigherStopOption) {
|
||||||
|
console.log(` 🎯 Tighter Stop: ${result.analysis.alternatives.tigherStopOption}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.alternatives.scaledEntry) {
|
||||||
|
console.log(` 📊 Scaled Entry: ${result.analysis.alternatives.scaledEntry}`)
|
||||||
|
}
|
||||||
|
if (result.analysis.alternatives.invalidationScenario) {
|
||||||
|
console.log(` ❌ Invalidation: ${result.analysis.alternatives.invalidationScenario}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('\n⚠️ No AI analysis results received')
|
console.log('\n⚠️ No AI analysis results received')
|
||||||
@@ -113,7 +224,8 @@ async function testDualSessionScreenshots() {
|
|||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
// Add fetch for Node.js environments that don't have it built-in
|
// Add fetch for Node.js environments that don't have it built-in
|
||||||
if (typeof fetch === 'undefined') {
|
if (typeof fetch === 'undefined') {
|
||||||
global.fetch = require('node-fetch')
|
const { default: fetch } = require('node-fetch')
|
||||||
|
global.fetch = fetch
|
||||||
}
|
}
|
||||||
|
|
||||||
testDualSessionScreenshots()
|
testDualSessionScreenshots()
|
||||||
|
|||||||
Reference in New Issue
Block a user