Performs Exploratory Data Analysis (EDA) on a MarketIntelligenceReport. Computes moving averages (MA10, MA20) from price history, generates Chart.js configuration objects for four chart types (price trend, volume, analyst consensus donut, news sentiment bars), and produces key textual insights via LLM.
Transform raw market data into visual and textual insights. This skill is the SECOND step in the QuantBot pipeline, always called after market-intelligence and before trade-recommendation.
From marketData.priceHistory (30 daily entries):
labels — date strings formatted as MM-DD (e.g., "03-17")prices — array of closing pricesvolumes — array of daily volumesHelper: computeMA(data, period) — for each index i, average the last period values (return null if fewer than data points exist).
periodTitle: "{TICKER} — 30-Day Price & Moving Averages"
Datasets:
- Price line (cyan #00d4ff, filled, tension 0.3, no point markers)
- MA10 dashed line (amber #f59e0b, dash [4,4])
- MA20 dashed line (green #10b981, dash [8,4])
Title: "{TICKER} — Volume Analysis"
Datasets:
- Volume bars — red (rgba(239,68,68,0.7)) if volume > avgVolume × 1.3, else cyan (rgba(0,212,255,0.4))
- Avg Volume reference line (amber dashed)
Title: "{TICKER} — Analyst Consensus"
Labels: ['Strong Buy', 'Buy', 'Hold', 'Sell', 'Strong Sell']
Colors: ['#10b981', '#6ee7b7', '#f59e0b', '#f87171', '#dc2626']
Data: [strongBuy, buy, hold, sell, strongSell]
Title: "{TICKER} — News Sentiment"
Labels: news source names
Dataset: sentiment scores per source
Colors: green (rgba(16,185,129,0.7)) if score > 0, red (rgba(239,68,68,0.7)) if score ≤ 0
Y-axis range: −1 to +1
Send a prompt to the LLM containing the following market data summary:
Request the LLM to return a JSON object:
insights — array of 4 key EDA observations (plain English, quantitative where possible)riskFlags — array of risk flags (e.g., "Overbought — potential pullback risk")technicalSummary — 1–2 sentences synthesising the technical picturemomentumSignal — one of: POSITIVE, NEGATIVE, NEUTRALThe LLM response must be JSON only. If the provider returns extra prose or fenced code, normalize and parse the structured payload before using it.
Compute insights deterministically:
> 70 → overbought, < 30 → oversold, else healthy range)edaFactors derived from breakout, volume regime, volatility regime, and trend-strength calculations{
"charts": {
"priceChart": { "type": "line", "title": "...", "data": { "labels": [], "datasets": [] } },
"volumeChart": { "type": "bar", "title": "...", "data": { "labels": [], "datasets": [] } },
"analystChart": { "type": "doughnut", "title": "...", "data": { "labels": [], "datasets": [] } },
"sentimentChart": { "type": "bar", "title": "...", "data": { "labels": [], "datasets": [] } }
},
"edaInsights": {
"insights": ["...", "...", "...", "..."],
"riskFlags": [],
"technicalSummary": "...",
"momentumSignal": "POSITIVE"
},
"skillUsed": "eda-visual-analysis"
}
references/chart-types.md for Chart.js configuration patterns and theming guidelines.