πŸ“ˆ Generate SENSEX trading signals using Gemini, Yahoo Finance and Google Sheets

⚑ 508 views Β· πŸ“ˆ Crypto Trading & Stock Market

Description

AI-Powered SENSEX Signal Generator

> Gemini, Yahoo Finance & Google Sheets


This n8n workflow automatically analyzes SENSEX market data using technical indicators and AI (Google Gemini) to generate trading signals (Buy/Sell). It filters only high-confidence signals and logs them into Google Sheets for tracking.

Quick Implementation Steps

  1. Import the workflow into your n8n account
  2. Add credentials:
    • Google Gemini API
    • Google Sheets OAuth2
  3. Create a Google Sheet with columns: Date | Index | Signal | Confidence | Trend | Reason
  4. Execute the workflow manually
  5. Check results in your Google Sheet

What It Does

This workflow automates stock market signal generation for the SENSEX index using a hybrid approach that combines technical analysis and AI-based reasoning.

First, it fetches historical market data from Yahoo Finance and computes key indicators such as moving averages, momentum, volatility and price change. These indicators help identify the current market trend and behavior.

Next, it retrieves the latest SENSEX-related news headlines and feeds both the technical data and news into a Google Gemini AI model. The AI analyzes this combined input to generate a trading signal (Buy/Sell), along with confidence, strength, risk level and reasoning.

Finally, the workflow calculates a score based on AI output, filters only high-quality signals (score > 70) and logs them into Google Sheets for further tracking and decision-making.

Who It’s For

Requirements

To use this workflow, you need:

How It Works & Setup Guide

Workflow Breakdown

  1. Manual Trigger

    • Starts the workflow execution manually
  2. Fetch Market Data

    • HTTP Request pulls SENSEX data from Yahoo Finance
  3. Technical Analysis

    • Code node calculates:
      • 5-day & 20-day moving averages
      • Momentum
      • Volatility
      • Price change (%)
  4. Data Structuring

    • Set node formats key metrics for AI processing
  5. Fetch Latest News

    • RSS node pulls SENSEX-related news from Google News
  6. Limit News

    • Only the latest article is passed to AI
  7. AI Signal Generation

    • Gemini AI analyzes:
      • Technical indicators
      • News sentiment
    • Outputs:
      • Signal (Buy/Sell)
      • Confidence
      • Strength
      • Risk level
      • Reason
  8. Parse AI Output

    • Converts AI response into structured JSON
  9. Score Calculation

    • Score is computed using:
      • Confidence
      • Strength
      • Risk level
  10. Validation

  1. Store Results

Setup Instructions

  1. Import workflow into your n8n account
  2. Configure credentials:
    • Google Gemini API
    • Google Sheets OAuth2
  3. Update Google Sheet ID (if needed)
  4. Verify API URLs:
    • Yahoo Finance endpoint
    • Google News RSS link
  5. Execute manually using Start node
  6. Check output in Google Sheets

How To Customize Nodes

Add-ons (Enhancements)

Use Case Examples

  1. Automated Trading Signal Logger

    • Generate and store signals daily
  2. AI-Assisted Decision Support

    • Use signals as guidance before trading
  3. Market Trend Monitoring System

    • Track trend + volatility over time
  4. Fintech Product Prototype

    • Build an AI-based trading assistant
  5. Research & Backtesting Tool

    • Analyze historical signals and performance

There can be many more use cases depending on how you want to extend this workflow.

Troubleshooting Guide

IssuePossible CauseSolution
No data from Yahoo FinanceAPI URL incorrect or rate-limitedVerify endpoint and retry
AI output not parsingInvalid JSON from AIEnsure prompt enforces strict JSON
No rows in Google SheetsValidation failed (score ≀ 70)Check score logic or lower threshold
Credential errorsMissing or incorrect API keysReconfigure credentials
Empty news inputRSS feed issueVerify RSS URL and connectivity
Workflow stops earlyNode misconfigurationCheck execution logs in n8n

Need Help?

If you need assistance with:

Feel free to reach out to n8n automation developers at WeblineIndia

We can help you build powerful automation workflows tailored to your business needs.

πŸ”— Nodes Used

Google Sheets, HTTP Request, RSS Read, AI Agent, Google Gemini Chat Model

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup