P25-10-28">
n8n AI Agents Finance
9 min read Automation

How to Build a Stock Analyst AI Agent With No Code

Traders spend hours each day analyzing charts and indicators - but what if an AI could do it for you? This n8n workflow creates a Telegram bot that analyzes any stock's technicals, compares performance, and delivers professional-grade insights automatically. No coding required - just connect the nodes and let AI handle the analysis.

The Problem: Manual Stock Analysis Takes Hours

Professional traders and serious investors know the drill: every morning begins with scanning charts, checking indicators, and analyzing price action. What looks like simple lines and candles to outsiders represents hours of technical analysis - identifying support/resistance levels, tracking MACD crossovers, watching volume patterns, and more.

For active traders, this manual analysis isn't just time-consuming - it's emotionally draining. The constant second-guessing ("Did I miss something in that chart pattern?") leads to analysis paralysis. Even with tools like TradingView, the cognitive load of interpreting multiple indicators adds up quickly.

80% of day traders report spending 2-3 hours daily just on technical analysis before making any trades. This workflow automates that initial screening process.

Solution Overview: AI-Powered Technical Analysis

The stock analyst AI agent solves this by combining three powerful technologies: n8n for workflow automation, Telegram for conversational interface, and AI vision models for chart analysis. Here's how it transforms the process:

  1. You message the bot on Telegram (e.g., "Analyze Microsoft")
  2. The AI agent fetches the latest chart with technical indicators
  3. GPT-4 Vision analyzes the chart patterns and indicators
  4. Claude synthesizes the findings into a professional analysis
  5. Results delivered back to you in Telegram within seconds

The system handles all the technical heavy lifting while you get the distilled insights. At 2:15 in the video tutorial, you can see the AI correctly identifying Microsoft's bullish trend continuation pattern and key support levels - analysis that would take a human 10-15 minutes to compile.

Workflow Architecture: How the Pieces Connect

This automation uses n8n's powerful workflow chaining capability to connect multiple services:

Key Insight: Unlike simpler chatbots, this system uses n8n's "workflow calling workflow" feature to maintain separation of concerns between the AI interface and the technical analysis engine.

The architecture has two main components:

1. The AI Agent (Main Workflow)

  • Telegram node for receiving messages
  • Claude AI node with custom trading analysis prompt
  • Memory node to remember previous analyses
  • Tool node to call the chart analysis workflow

2. The Chart Analysis Tool (Secondary Workflow)

  • chartsimage.com API for generating technical charts
  • OpenAI GPT-4 Vision for analyzing the chart image
  • Response formatting for Telegram output

This separation allows each component to focus on its specialty while communicating through clean interfaces - a best practice for complex automations.

Step 1: Setting Up the Telegram Connection

The Telegram bot serves as the user-friendly frontend to your stock analysis system. Here's how to configure it in n8n:

Step 1.1: Create Your Telegram Bot

Message @BotFather on Telegram and follow the prompts to create a new bot. You'll receive an API token - this is your bot's password for the n8n integration.

Step 1.2: Configure the Telegram Trigger Node

In n8n, add a Telegram Trigger node and paste your bot token. The critical output fields are:

  • chatId - Identifies the conversation thread
  • text - Contains the user's message (e.g., "Analyze MSFT")

Step 1.3: Test the Connection

Send a test message to your bot. You should see the execution appear in n8n's workflow history with the message details. At 4:30 in the video, you can see this debugging process in action.

Step 2: Configuring the AI Agent Brain

The Claude AI node serves as the "brain" that coordinates the analysis. Here's how to set it up for optimal stock analysis:

Step 2.1: Connect Your Claude API

Create an API key at anthropic.com and add it to n8n's Claude node. Use the claude-3-opus model for best results with financial analysis.

Step 2.2: Craft the System Prompt

The prompt engineering is critical. Our tested structure includes:

  • Identity: "You are a professional technical analysis AI specializing in US equities"
  • Context: Explanation of candlestick patterns, indicators, etc.
  • Instructions: Step-by-step analysis methodology
  • Tools: Documentation for the get_chart tool
  • Examples: Sample analyses for different scenarios

Step 2.3: Add Memory Context

Connect a Memory node with context window of 5 to enable comparisons like "Compare this to Apple's chart from yesterday." This creates a conversational experience.

Pro Tip: At 7:45 in the video, you'll see how the memory function allows the AI to recall previous analyses when comparing stocks - a game-changer for tracking portfolio performance.

Step 3: Building the Chart Analysis Tool

The chart analysis workflow is where the technical magic happens. Here's how to construct it:

Step 3.1: Set Up chartsimage.com API

Register at chartsimage.com to get your API key. The free tier allows 50 requests/day - sufficient for most individual traders.

Step 3.2: Configure the HTTP Request

Add an HTTP Request node in n8n with these settings:

  • Method: POST
  • URL: https://api.chartsimage.com/storage
  • Headers: Content-Type: application/json
  • Body: {"symbol":"NASDAQ:{{ticker}}","options":{"chart":{"type":"candlestick"}}}

Step 3.3: Add GPT-4 Vision Analysis

Connect an OpenAI node configured for image analysis. The prompt should request:

  • Candlestick pattern identification
  • MACD and volume analysis
  • Support/resistance levels
  • Overall trend assessment

At 12:20 in the video, you can see how the binary image data flows from the chart API directly into GPT-4's vision model for analysis.

Step 4: Testing and Refining the Workflow

With all components connected, it's time to validate the system:

Step 4.1: Test Individual Stocks

Start with simple requests like "Analyze AAPL". Check that:

  • The correct chart generates
  • AI analysis covers all requested indicators
  • Output formats cleanly in Telegram

Step 4.2: Validate Comparisons

Test multi-stock queries like "Compare MSFT to AAPL". The workflow should:

  • Process each stock sequentially
  • Maintain context between analyses
  • Provide a consolidated comparison

Step 4.3: Handle Edge Cases

Add error handling for:

  • Invalid ticker symbols
  • API rate limits
  • Unclear user requests

At 16:40 in the video, you'll see the system smartly handle a three-way comparison between Amazon, Apple, and Microsoft - demonstrating the memory and analysis capabilities working in concert.

Advanced Features: Multi-Stock Comparisons

Once the basic workflow is functioning, consider these enhancements:

Portfolio Analysis Mode

Modify the prompt to accept messages like "Analyze my portfolio: AAPL 30%, MSFT 25%, GOOG 45%" and provide weighted analysis.

Alert Thresholds

Add conditional logic to message you when specific patterns emerge (e.g., "Alert me if RSI crosses 70").

Historical Comparisons

Extend the memory function to compare current charts to historical patterns from weeks/months ago.

Sector Analysis

Add sector ETF comparisons to contextualize individual stock performance.

The beauty of building this in n8n is how easily you can extend the functionality. Each new feature typically just requires adding another node or modifying the AI prompt - no complex coding needed.

Watch the Full Tutorial

See the complete build process from start to finish in this 19-minute tutorial. At 9:15, you'll get an especially clear look at how the AI agent prompt is structured for optimal stock analysis.

Video tutorial: Building a stock analyst AI agent with n8n

Key Takeaways

This stock analyst AI agent demonstrates how n8n can transform complex, time-consuming processes into automated systems that deliver professional results. Here's what makes it powerful:

In summary: By combining n8n's workflow automation with AI analysis and Telegram's messaging interface, you can create a stock analysis assistant that saves hours per week while providing consistent, unbiased technical insights.

  1. No-code automation makes professional-grade analysis accessible to all traders
  2. AI vision models can accurately interpret technical charts when properly prompted
  3. Workflow chaining in n8n enables complex systems with clean separation of concerns
  4. Conversational interfaces via Telegram make the system intuitive to use daily

Frequently Asked Questions

Common questions about this topic

The AI agent analyzes stock charts using technical indicators like MACD, volume analysis, and support/resistance levels. It can analyze individual stocks or compare multiple stocks, delivering the insights directly to you via Telegram.

The system automatically fetches the latest charts, processes them through AI analysis, and formats the results in an easy-to-understand report. This eliminates hours of manual chart analysis while providing consistent, unbiased technical assessments.

  • Provides professional-grade technical analysis on demand
  • Compares multiple stocks side-by-side
  • Delivers results via convenient Telegram interface

No coding is required. The entire system is built using n8n's visual workflow builder, connecting pre-built nodes for Telegram, AI analysis, and chart generation.

The tutorial walks through each step visually, showing exactly how to connect the components without writing any code. You'll be dragging and dropping nodes rather than writing scripts or functions.

  • Uses n8n's no-code visual interface
  • Connects pre-built nodes for each function
  • No programming knowledge required

The workflow uses Claude for the main AI agent processing and OpenAI's GPT-4 Vision for analyzing the stock charts. These are connected through API nodes in n8n.

Claude handles the conversational interface and synthesis of findings, while GPT-4 Vision specializes in interpreting the visual chart patterns. The system is designed to be modular, so you could easily swap in different AI models if preferred.

  • Claude 3 for conversation and analysis synthesis
  • GPT-4 Vision for interpreting chart images
  • Modular design allows model substitution

The AI provides technical analysis based on chart patterns and indicators, not financial advice. In testing, it correctly identified trends and patterns about 80-85% of the time when compared to human analyst interpretations.

The system is best used as a supplemental tool rather than sole decision-maker for trading. It excels at quickly screening charts and highlighting potential areas for deeper human analysis.

  • Matches human analysis 80-85% of the time
  • Best for initial screening vs. final decisions
  • Provides unbiased, consistent assessments

Currently the workflow is configured for NASDAQ stocks using their ticker symbols. You would need to modify the chart generation API calls to support other exchanges.

The tutorial explains how to adapt the system for different data sources by changing the API endpoint configurations. With some adjustments, you could analyze stocks from NYSE, London Stock Exchange, or other major markets.

  • Default setup works for NASDAQ stocks
  • Modifiable for other US exchanges
  • International markets require API adjustments

The main costs are the AI API calls: Claude costs about $0.10 per analysis, GPT-4 Vision about $0.15 per chart. The chart API has a free tier (50/day). For moderate usage (20 analyses/day), expect $5-10/month in API costs.

The n8n workflow itself runs for free on their cloud plan. Telegram bot operation has no additional costs beyond standard messaging rates.

  • AI API costs: $0.25 per full analysis
  • Chart API: Free for ≤50/day
  • Typical monthly cost: $5-10

The workflow uses chartsimage.com's free API to generate technical charts. You simply send the stock ticker to their endpoint, and it returns a professional candlestick chart with common indicators.

The API handles all the complex chart rendering so your workflow just needs to pass the ticker symbol. It supports various chart types (candlestick, line, bar) and can include indicators like MACD, RSI, and Bollinger Bands.

  • chartsimage.com provides free chart API
  • Handles all technical rendering
  • Supports multiple chart types/indicators

GrowwStacks specializes in building custom AI automation solutions like this stock analysis agent. We can implement this exact workflow for your firm, adapt it for different markets/data sources, or create completely custom financial analysis automations.

Our team handles all the technical setup so you get a turnkey solution ready to use. We offer free consultations to discuss your specific requirements and how automation could streamline your analysis processes.

  • Custom implementation of this workflow
  • Adaptations for different markets/data sources
  • Free consultation to discuss your needs

Ready to Automate Your Stock Analysis?

Manual chart analysis steals hours from your trading week - time you could spend executing strategies instead of preparing them. Our team can have this AI analysis system running for your portfolio in under 48 hours.