Skip to content

fikrinotes/Trading-With-Bayesian-LSTM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Trading-With-Bayesian-LSTM

Hugging Face

This repository contains the implementation of a Bayesian Long Short-Term Memory (Bayesian LSTM) model designed to predict hourly log returns and estimate both Epistemic and Aleatoric uncertainty for major cryptocurrency assets (SOL, BTC, and DOGE).

This project is part of a Master's Thesis in Mathematics (Statistics Concentration) at Andalas University.

🧠 Model Features

  • Bayesian Inference: Built using blitz-bayesian-pytorch for Variational Inference.
  • Uncertainty Estimation: Quantifies market noise (aleatoric) and model confidence (epistemic) using Monte Carlo Sampling.
  • Feature Engineering: Includes log returns, volatility metrics, and cyclical time encoding (sin/cos).
  • Multi-Asset: Pre-trained weights and artifacts for Solana (SOL), Bitcoin (BTC), and Dogecoin (DOGE).

📂 Repository Structure

  • data: The data used in this research.
  • notebooks: Jupyter notebook file for model development.
  • requirements.txt: Necessary libraries.

📈 Performance Summary

Results based on backtesting process using Bayesian LSTM model for trading strategy on the test data (Jan 2025 - Nov 2025):

Asset RMSE Sharpe Ratio PICP (95% CI)
Solana (SOL) 0.0094 0.7631 0.7631
Bitcoin (BTC) 0.0048 -0.0112 -0.0112
Dogecoin (DOGE) 0.0103 0.8999 0.8999

📈 Detailed Backtesting Results

Click to expand: Cumulative Returns of gain from Bitcoin

Backtesting Plot

Click to expand: Cumulative Returns of gain from Solana

Backtesting Plot

Click to expand: Cumulative Returns of gain from Dogecoin

Backtesting Plot

Download the models at HuggingFace.

About

Autonomous crypto trading system using Bayesian Deep Learning to estimate market volatility and optimize portfolio, with Risk-Adjusted Return (RAR) Analysis.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors