Daily Stock Market Analysis Reports
Fetch daily US stock market data via Alpha Vantage, generate AI-powered technical analysis reports, and deliver them to Gmail, Telegram, and Google Sheets.
What This Workflow Does
This workflow automatically fetches US stock market data every weekday morning and produces an AI-generated technical analysis report. It pulls real-time quotes (or last trading day data when the market is closed), top gainers/losers, and news sentiment from Alpha Vantage. An AI agent then analyzes everything and delivers a polished report to your Gmail inbox, Telegram chats, and a Google Sheet for historical tracking.
What You Need
- Alpha Vantage API Key — for querying market status, stock quotes, top movers, and news sentiment. Get a free key at alphavantage.co.
- AI API Key — for the AI model that generates the analysis report.
- Gmail account — connected via Pipedream connector to send email reports.
- Telegram bot and chat ID — to receive notifications in a personal chat or channel.
- Google Sheets — connected via Pipedream connector to log data for historical tracking.
How the Flow Works
| Step | Node | Description |
|---|---|---|
| 1 | Scheduled Trigger | Runs at 9:00 AM UTC, Monday through Friday. |
| 2 | HTTP Request (Market Status) | Queries Alpha Vantage MARKET_STATUS to check if the US equity market is open or closed. |
| 3 | Code (Parse Market Status) | Interprets the response and prepares a list of 7 stock symbols to track (AAPL, MSFT, GOOGL, AMZN, TSLA, NVDA, META). |
| 4 | Code (Build Quote URLs) | Constructs individual Alpha Vantage GLOBAL_QUOTE API URLs for each symbol. |
| 5 | HTTP Requests (Global Quotes) | Fetches detailed stock quotes for each symbol in parallel. |
| 6 | HTTP Request (Top Gainers/Losers) | Fetches the top market gainers, losers, and most actively traded stocks. |
| 7 | HTTP Request (News Sentiment) | Fetches the latest news articles with sentiment scores for the tracked tickers. |
| 8 | Code (Interpret Stock Data) | Parses quote data, calculates buy/sell/neutral signals based on price change percentages. |
| 9 | Merge | Combines the three data streams: stock quotes, top movers, and news sentiment. |
| 10 | Code (Consolidate Data) | Structures all data into a single object ready for AI analysis. |
| 11 | Code (Build AI Request) | Constructs the AI model request with a detailed prompt requesting a 7-part analysis report. Web search is enabled for additional context. |
| 12 | HTTP Request (AI API Call) | Sends the consolidated data to the AI model for analysis. |
| 13 | Code (Parse AI Response) | Extracts the generated analysis text from the AI response. |
| 14 | Code (Prepare Output Messages) | Formats the analysis into HTML (for email), Markdown (for Telegram), and plain text (for Sheets). |
| 15 | Gmail Send Email | Sends the full report as an HTML email. |
| 16 | Telegram (Personal Chat) | Sends the analysis to your personal Telegram chat. |
| 17 | Telegram (Channel) | Broadcasts a summary to a Telegram channel. |
| 18 | Google Sheets Append Row | Logs the analysis data to a spreadsheet for archival. |
Trading Signal Logic
The workflow classifies each stock based on its daily price change percentage:
| Price Change | Signal |
|---|---|
| Greater than +2% | STRONG BUY SIGNAL |
| +0.5% to +2% | BULLISH |
| -0.5% to +0.5% | NEUTRAL |
| -2% to -0.5% | BEARISH |
| Less than -2% | STRONG SELL SIGNAL |
AI Analysis Report Contents
The AI agent is prompted to produce a 7-part report:
- Market Overview — Overall market sentiment based on all available data.
- Individual Stock Analysis — Price, change, volume, and signals for each tracked stock.
- Technical Signals — Bullish/bearish patterns and key support/resistance levels.
- Top Movers Insight — Analysis of the day's biggest gainers, losers, and most active stocks.
- News Impact Analysis — How recent news sentiment affects the tracked stocks.
- Recommendations — Actionable buy/hold/sell insights with reasoning.
- Risk Assessment — Potential risks and market concerns.
Output
You receive the analysis report in three places:
- Gmail — A formatted HTML email with the full report.
- Telegram — A personal message and a channel broadcast (Markdown formatted, truncated to Telegram's 4,096-character limit).
- Google Sheets — A new row with the timestamp, date, and analysis text for historical comparison.
Configuration Notes
- Replace
YOUR_CHAT_IDwith your actual Telegram user or chat ID. - Replace
@YOUR_CHANNELwith your Telegram channel username. - Replace
YOUR_SPREADSHEET_IDwith your Google Sheets spreadsheet ID and configure the worksheet name. - Update the recipient email address in the Gmail node.
- To track different stocks, edit the symbols array in the "Parse Market Status" code node.
- Alpha Vantage free-tier API keys have rate limits (typically 25 requests per day). If you're tracking many symbols or running frequently, consider upgrading your plan.
- The workflow always fetches the most recent available data, even when the market is closed, so you'll still receive a report on any weekday.
Want to showcase your own workflows?
Become a Needle workflow partner and turn your expertise into recurring revenue.
