Quantitative Data Science & Backend Engineering • In Progress

QuantPulse BTC

An advanced quantitative BTCUSD trading research and backtesting suite featuring machine learning volatility forecasting and FinBERT-powered financial news sentiment analysis.

GitHub Repo Back to Home

Project Overview

An advanced quantitative BTCUSD trading research and backtesting suite featuring machine learning volatility forecasting and FinBERT-powered financial news sentiment analysis.

The Problem

- Quantitative trading strategy development typically happens in fragmented Jupyter Notebooks, making it difficult to simulate realistic market conditions like latency, execution slippage, and trading fees. - Standard sentiment analysis tools rely on generic NLP text models that fail to correctly capture domain-specific context in financial and cryptocurrency news headlines. - Transitioning historical trading models from backward-looking backtest engines to asynchronous live-paper trading simulations usually requires completely rewriting the codebase.

The Solution

Built a unified, asynchronous platform using FastAPI and PostgreSQL to bridge the gap between financial research and production engineering. Implemented an event-driven backtesting loop that replays historical candle data using vectorized Pandas operations while enforcing realistic fill logic, tracking portfolio balance states dynamically via SQLAlchemy ORM. Integrated an automated NLP ingestion pipeline utilizing a Hugging Face FinBERT model running as decoupled background tasks to score crypto news sentiment streams without blocking the main dashboard. Additionally, incorporated tree-based machine learning models (XGBoost Classifier/Regressor) to extract predictive regime-shifting and volatility insights from technical market indicators.

Architecture & System Flow

The platform utilizes a multi-layered hybrid architecture managed entirely via FastAPI and an ASGI Uvicorn server runtime. A PostgreSQL database layer holds decoupled states for wallets, trade books, and ingested sentiment markers using structured SQLAlchemy schemas. The analytical layer features a walk-forward validated XGBoost model matrix paired with a background RSS news processing worker. The presentation view layer delivers real-time portfolio updates and performance charting directly to a lightweight browser UI utilizing fast CDN-hosted Chart.js and lightweight-charts configurations connected via web sockets.

Key Features

  • Event-driven historical candle replay engine with transaction fee and slippage modeling.
  • Asynchronous paper trading simulator using a relational database persistence layer.
  • News ingestion pipeline with Hugging Face FinBERT domain-specific sentiment scoring.
  • XGBoost machine learning predictive models for market volatility and price direction.
  • Dynamic data visualization dashboard powered by FastAPI endpoints and Chart.js graphics.
  • Modular rule-based strategy interface built for extensible feature discovery.

Challenges Faced

- Challenge: Running heavy Transformer deep-learning inference models inside web request paths froze the single-threaded event loop. - Solution: Decoupled the FinBERT processing pipeline by wrapping news fetch routines into an isolated async background scheduler that commits pre-computed results directly to the Postgres layer. - Challenge: Handling messy time-series data streams risked producing data leakage or look-ahead bias during training indicator generation phases. - Solution: Enforced absolute temporal boundaries using specialized logical limits within Pandas indexing blocks alongside rolling window methods, strictly validating that feature state 't' only pulls historical arrays spanning 0 to t-1.

Results & Metrics

- Successfully decoupled computational NLP modeling (FinBERT) from the API thread pool, lowering dashboard endpoint latency to under 50ms. - Built a highly modular base strategy class pattern allowing rapid plug-and-play simulation for new mathematical trading rules. - Engineered 25+ technical and market-sentiment features processed via optimized, vectorized NumPy array code blocks to completely avoid look-ahead bias during time-series processing splits.

Project Gallery

Thumbnail

Thumbnail

Gallery image

Screenshot 1

Gallery image

Screenshot 2

Gallery image

Screenshot 3

Gallery image

Screenshot 4

Gallery image

Screenshot 5

Gallery image

Screenshot 6

Tech Stack

FastAPI PostgreSQL SQLAlchemy Python XGBoost FinBERT Transformers Pandas WebSockets Chart.js

Interested in this project?

Let's discuss how we can leverage these technologies and methods to build scalable systems for your engineering needs.

Get In Touch Download Resume