Skip to content

rohan-shyam/Fin-TSP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Live Website: https://fin-tsp-qtqp.vercel.app/

💹 Fin-TSP: Neural Time-Series Terminal

Fin-TSP (Financial Time Series Prediction) is a high-performance Neural Terminal designed for the Indian Stock Market (NSE/BSE). This project moves away from traditional 1D price-action models, treating market dynamics as a Computer Vision problem. By converting raw price action into 2D Spectrograms via Short-Time Fourier Transform (STFT), a Convolutional Neural Network (CNN) identifies hidden spectral patterns in volatility to predict next-day price movements.


🛠️ Technical Stack

Backend (The Engine)

  • Framework: FastAPI (Python 3.11)
  • Deep Learning: TensorFlow-CPU (Memory-optimized for 512MB RAM constraints)
  • Signal Processing: SciPy (STFT spectral mapping)
  • Data Ingestion: yFinance (Real-time NSE/BSE data)
  • Deployment: Render (Web Service)

Frontend (The Terminal)

  • Framework: Next.js 15 (App Router / Turbopack)
  • Styling: Tailwind CSS (Neural-Dark Theme)
  • Visuals: Chart.js, Lucide React, & Framer Motion (Glow-effects/Animations)
  • Deployment: Vercel

🧠 Core Architecture & Pipeline

The prediction pipeline follows a rigorous four-stage process:

  1. Normalization: Raw OHLC data is scaled to ensure feature consistency across 5,300+ supported assets.
  2. STFT Mapping: 1D price time-series is transformed into a 60x60 spectral image, capturing both time and frequency domains.
  3. CNN Inference:
    • Conv2D Layers: Slide kernels over the spectrogram to detect "edges" in volatility and spectral density.
    • MaxPool: Downsamples features to ensure translation invariance.
    • Dense Head: A linear head performs the final regression to output the Predicted T+1 Price.
  4. Backtesting: The system compares predictions against historical truth to calculate Directional Accuracy metrics.

Screenshots image image

💻 Local Setup

Ensure you have the necessary build tools:

  1. Clone the Repository:

    git clone [https://github.com/rohan-shyam/Fin-TSP.git](https://github.com/rohan-shyam/Fin-TSP.git)
    cd Fin-TSP
  2. Backend Setup:

    cd backend
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    uvicorn app.main:app --reload
  3. Frontend Setup:

    cd ../frontend
    npm install
    npm run dev

📈 Roadmap

  • STFT Spectrogram Integration
  • CNN Model Training & Inference
  • Real-time NSE Ticker Search
  • Vercel & Render Production Deployment

Author: Rohan Shyam

About

Search for a NSE Stock such as "SUZLON" or "MARUTI" to get started

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors