Built a $0/mo AI Quantitative Investment & Paper Trading Platform with n8n, Groq & Google Sheets

:rocket: Built a Zero-Cost AI Quantitative Stock Scoring & Paper Trading Platform with n8n, Groq & Google Sheets

Hey n8n Community! :waving_hand:

I wanted to share a project I built recently: KKH Investment Portfolio (HKS Automations)β€”an automated, rule-based quantitative investment engine and live paper trading dashboard for the Indian Stock Market (NSE/BSE).

Most quant tools require expensive infrastructure (AWS, PostgreSQL, paid market data APIs). I built this platform for $0/month by leveraging n8n as the primary orchestrator!


:bullseye: Platform Overview & Core Features

  1. Weekly Multi-Factor Stock Scoring (0–100 Scale): Evaluates a 35+ stock watchlist every week across 8 weighted categories:

    • Fundamental Quality (25%) | Growth (15%) | Valuation (15%)
    • Technical Indicators (15%) | Sector Outlook (10%) | Risk Safety (10%)
    • Institutional Activity (5%) | AI News Sentiment (5%)
  2. AI News Sentiment Analysis: Pulls live Google News RSS headlines and passes them to Groq LLM (Llama 3.3) to return structured JSON sentiment scores (0–5) and one-line investment theses.

  3. Multi-Channel Dispatch: Formats and sends an executive HTML report via Gmail and a concise Markdown briefing string via WhatsApp Webhook.

  4. Live Paper Trading Terminal: Feeds a single-file static web terminal hosted on GitHub Pages with an active paper trading wallet (β‚Ή10 Lakhs starting virtual balance), position tracking, and automated risk guardrails.


:building_construction: Architecture Blueprint

[ Weekly Schedule Trigger (Thursday 11:30 PM IST) ]
                       β”‚
                       β–Ό
         [ Read Google Sheet Watchlist ]
                       β”‚
                       β–Ό
      [ Loop Node (Sequential Stock Processing) ]
                       β”‚
      β”œβ”€β”€β–Ί Fetch Google News RSS Headlines
      β”œβ”€β”€β–Ί Call Groq LLM (Llama 3.3) for Sentiment & Thesis
      └──► Write Scores & AI Verdict Back to Google Sheets
                       β”‚
                       β–Ό
           [ "Done" Branch of Loop ]
                       β”‚
      β”œβ”€β”€β–Ί Generate Executive HTML Email & Send
      β”œβ”€β”€β–Ί Format WhatsApp Briefing String & Post via Webhook
      └──► Log Workflow Execution Metrics

:high_voltage: Key Engineering Patterns

  • Zero Race Conditions: All reporting and notification nodes (Gmail & WhatsApp) are attached directly to the β€œDone” output branch of the Loop Node. This guarantees that notifications fire only after all watchlist assets have been processed and written back to Google Sheets.

  • Instant Load (<0.1s) Terminal: The GitHub Pages frontend utilizes a local storage caching engine to render portfolio metrics instantly, syncing silently with Google Apps Script API in the background.

  • CORS Preflight Workaround: Paper trade execution POST requests use headers: { "Content-Type": "text/plain;charset=utf-8" } to prevent browser OPTIONS preflight blocks on Google Apps Script Web App endpoints.

:file_folder: Workflow File

:paperclip: Attached Workflow: You can download the sanitized workflow JSON directly below to import into your own n8n instance:

(Note: Upload your KKH AI Investment Platform.json file using the forum file attachment button right here!)

Would love to hear your thoughts, suggestions, or feedback from the community! Feel free to ask any questions about setting up Groq LLMs in n8n or using Google Sheets as a database.

KKH AI Investment Platform (n8n).json (37.3 KB)