An open API service indexing awesome lists of open source software.

https://github.com/neuraladitya/trade_predictor_project

An AI-powered trade prediction system using machine learning, technical analysis, and time series models. Built with FastAPI, React, and Tailwind CSS.
https://github.com/neuraladitya/trade_predictor_project

arima csv-analysis fastapi financial-data kalman-filter machine-learning markov-models pca prediction-system random-forest react stock-market tailwindcss tda technical-indicators trade-prediction tsne vite wavelet-transform

Last synced: about 2 months ago
JSON representation

An AI-powered trade prediction system using machine learning, technical analysis, and time series models. Built with FastAPI, React, and Tailwind CSS.

Awesome Lists containing this project

README

          

# ๐Ÿง  NeuralAditya - Trade Prediction Project

[![Build Status](https://img.shields.io/badge/build-passing-brightgreen)](#)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
[![Node](https://img.shields.io/badge/node-18%2B-green.svg)](https://nodejs.org/)
[![License](https://img.shields.io/badge/license-MIT-lightgrey)](LICENSE)

**Trade Prediction Project** is an advanced and modular trade prediction system that combines state-of-the-art **machine learning** and **signal processing techniques** to provide highly accurate stock trend forecasts.

Built with a powerful **FastAPI backend** and a modern **Vite + React + TailwindCSS frontend**, this full-stack application is optimized for **real-time interaction** and **predictive insight delivery**.

## ๐Ÿ” Core Features

- ๐Ÿ”— **FastAPI Backend**: Lightweight and high-performance API for fast data processing and model predictions.
- โš›๏ธ **React + Vite Frontend**: Ultra-fast UI built with Vite, React, TailwindCSS, and ShadCN.
- ๐Ÿ“ˆ **ML Algorithms**: Random Forest, ARIMA, and Markov Switching models for robust predictions.
- ๐Ÿ”ง **Fourier Transform Analysis**: Extracts frequency-domain features to capture cyclic trends in data.
- ๐ŸŒŠ **Wavelet Transform**: Multi-resolution analysis to uncover short-term vs long-term volatility patterns.
- ๐Ÿ“ก **Kalman Filter**: Smooths noisy market signals and estimates hidden state trends.
- ๐Ÿ“ **Topological Data Analysis (TDA)**: Captures shape and structure of time-series data using persistence diagrams.
- ๐Ÿงฎ **Technical Indicators**: Includes RSI, MACD, EMA, Bollinger Bands, and more.
- ๐ŸŽฏ **Dimensionality Reduction**: Uses PCA and t-SNE for compressing and visualizing high-dimensional features.
- ๐Ÿ–ผ๏ธ **Live Graphs**: UI displays prediction results and historical performance in interactive charts.
- ๐Ÿงพ **CSV Upload & Visualization**: Upload any stock OHLCV CSV and view results instantly.

## โšก Use Cases

- Short-term & long-term stock trend forecasting
- Backtesting and model evaluation
- Educational tool for data science and trading students
- Research into hybrid models and multi-signal strategies
---

## ๐Ÿ“ธ Frontend Screenshot


Trade Predictor UI

---

## ๐Ÿ“ Project Structure

```bash
Trade_Predictor_Project/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚ โ”œโ”€โ”€ api/
โ”‚ โ”‚ โ””โ”€โ”€ predict.py # Main prediction endpoint logic
โ”‚ โ”œโ”€โ”€ models/
โ”‚ โ”‚ โ””โ”€โ”€ train_model.py # (Optional) Re-train ML models
โ”‚ โ”œโ”€โ”€ utils/
โ”‚ โ”‚ โ””โ”€โ”€ helpers.py # (Optional) Any helper functions
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ”œโ”€โ”€ main.py # FastAPI entrypoint
โ”‚ โ””โ”€โ”€ requirements.txt # Backend dependencies
โ”‚
โ”œโ”€โ”€ frontend/
โ”‚ โ”œโ”€โ”€ src/
โ”‚ โ”‚ โ””โ”€โ”€ TradePredictApp.tsx # UI for file upload and results
โ”‚ โ”œโ”€โ”€ public/
โ”‚ โ”‚ โ””โ”€โ”€ screenshot.png # UI screenshot image
โ”‚ โ”œโ”€โ”€ package.json
โ”‚ โ”œโ”€โ”€ postcss.config.js
โ”‚ โ”œโ”€โ”€ tailwind.config.js
โ”‚ โ”œโ”€โ”€ vite.config.ts
โ”‚ โ””โ”€โ”€ tsconfig.json
โ”‚
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore
```

---

## ๐Ÿš€ Getting Started

### ๐Ÿง  Backend (FastAPI)

```bash
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
uvicorn main:app --reload
```

Backend will be running at: [http://localhost:8000](http://localhost:8000)

---

### ๐Ÿ’ป Frontend (Vite + React)

```bash
cd frontend
npm install
npm run dev
```

Frontend will be running at: [http://localhost:5173](http://localhost:5173)

Ensure the backend is also running for full functionality.

---

## ๐Ÿ“ค API Endpoint

### `POST /api/predict`

Upload a `.csv` file with the following required columns:

```
Open, High, Low, Close, Volume
```

#### โœ… Example Response

```json
{
"accuracy": 0.8123,
"confusion_matrix": [[100, 20], [15, 80]]
}
```

---

## ๐Ÿณ Docker (Run Full Stack)

```bash
docker-compose up --build
```

> Make sure Docker is installed and running before executing.

---

## โœ… Requirements

- Python 3.10+
- Node.js 18+
- Docker (optional)

---

## ๐Ÿ“„ License

MIT ยฉ 2025 NeuralAditya