Automate stock trades with AI-driven technical analysis & Alpaca Trading
Needs changesNeeds changes. This template uses 1 thing(s) that n8n 3.0 removes: AI Agent v1 (old agent modes). 1 breaking item(s) found. Static check, last run 2026-10-19.
What to replace before upgrading
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) Trend + Technical Agent (v1.7) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (26)
- Think Tool
@n8n/n8n-nodes-langchain.toolThink - Supabase Vector Store
@n8n/n8n-nodes-langchain.vectorStoreSupabase - Embeddings OpenAI
@n8n/n8n-nodes-langchain.embeddingsOpenAi - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Recursive Character Text Splitter
@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter - Reranker Cohere
@n8n/n8n-nodes-langchain.rerankerCohere - Http Request Tool
n8n-nodes-base.httpRequestTool - Call n8n Workflow Tool
@n8n/n8n-nodes-langchain.toolWorkflow - Edit Fields (Set)
n8n-nodes-base.set - OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter - HTTP Request
n8n-nodes-base.httpRequest - Merge
n8n-nodes-base.merge - Code
n8n-nodes-base.code - OpenAI
@n8n/n8n-nodes-langchain.openAi - Aggregate
n8n-nodes-base.aggregate - Split Out
n8n-nodes-base.splitOut - Limit
n8n-nodes-base.limit - Calculator
@n8n/n8n-nodes-langchain.toolCalculator - Postgres Tool
n8n-nodes-base.postgresTool - AI Agent
@n8n/n8n-nodes-langchain.agent - Schedule Trigger
n8n-nodes-base.scheduleTrigger - AI Agent Tool
@n8n/n8n-nodes-langchain.agentTool - Filter
n8n-nodes-base.filter - Gmail
n8n-nodes-base.gmail - Markdown
n8n-nodes-base.markdown - Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
What it does
📊 AI-Powered Stock Analysis & Auto-Trading Workflow Supercharge your trading decisions with this end-to-end AI automation that connects market intelligence, technical analysis, and automated trade execution — all without manual intervention. !image.png(fileId:2056) --- My results so far: (100k paper trading account with the current template strategy) !image.png(fileId:2055) 🚀 What This Workflow Does - Live AI-Driven Market Scanning Integrates with Danelfin’s AI scoring system to identify top stocks daily based on technical, fundamental, sentiment, and risk scores. - Advanced Technical & Trend Analysis Combines chart patterns, Fibonacci retracements, Bollinger Bands, MACD, RSI, EMA trends, and support/resistance detection with real-time news sentiment to produce clear, professional-grade analysis reports. - Chart Image AI Analysis Uses LLM-powered vision models to interpret candlestick charts visually and extract pattern, trend, and indicator insights. - Automated Trade Execution Integrates with Alpaca Paper Trading API for secure, rule-based buy/sell execution. Includes: - Risk management (position sizing, stop-loss/take-profit) - Account balance & buying power checks - No-repeat-loss policy - Data Storage & Strategy Memory Logs trades, PnL, and objectives in PostgreSQL for ongoing strategy refinement. - Automated Reporting Sends deep-dive market and trade reports directly to your email. --- 🔗 Integrated Services - Danelfin API – AI-based stock ranking - Supabase Vector Store – Strategy and knowledge retrieval - TwelveData API – Market prices & indicators - Chart-img API – TradingView chart generation - Alphavantage – News sentiment feed - Alpaca API – Automated order execution - OpenAI, Anthropic, Cohere, OpenRouter – Multi-model AI reasoning --- 📥 Perfect For - Quantitative analysts testing strategies - Investors looking for data-backed, automated execution - Educational environments for learning AI-based market strategies - People that want to know Real results Results --- 💼 What You Get Full Setup - Pre-configured n8n workflow with all nodes and logic ready to run - Step-by-step API key integration guide for Danelfin, Alpaca, TwelveData, Alphavantage, Chart-img - Database logging setup with PostgreSQL schema - Automated email reporting template Detailed Description - Explanation of every sub-agent and AI integration - How the strategy agent selects stocks based on AI scores and past trades - Deep technical indicators breakdown (EMA, RSI, MACD, Fibonacci, Bollinger, Support/Resistance) - Risk management methodology and allocation rules Examples - Daily Automated Analysis: Every morning the system emails you the top 3 stocks to watch, with price, chart, and sentiment score - Trade Execution: System buys AAPL with a defined stop-loss and take-profit based on technical setup - Chatbot Mode: Ask “What’s the trend on TSLA?” and get a concise, professional-grade market report instantly --- 💡 Why You’ll Love It This isn’t just an automation — it’s a full-stack AI trading assistant that thinks, analyzes, and executes while keeping risk in check. From sourcing the idea to placing the trade, it’s all covered. --- 🔑 Get Started Replace the placeholder API keys, set your trading preferences, and let the automation do the heavy lifting.