This repository contains the implementation of an algorithmic trading model for the BTC-USD cryptocurrency market. The model is built using a Long Short-Term Memory (LSTM) neural network for time series forecasting. The project aims to predict price movements and make trading decisions based on historical market data.
Algorithmic trading involves using automated systems to make trading decisions. This project focuses on predicting BTC-USD price movements and implementing a trading strategy using an LSTM-based model. The model is trained on historical market data and tested through backtesting to evaluate its performance.
- Python: Programming language used for implementation.
- Pandas: Data manipulation and analysis.
- NumPy: Numerical operations on arrays.
- Matplotlib: Data visualization.
- Scikit-learn: Machine learning library for train-test split and data preprocessing.
- Keras (with TensorFlow backend): Building and training the LSTM model.
The dataset used for training and testing includes historical BTC-USD market data, such as open, high, low, close prices, and volume.
The raw dataset is preprocessed to handle missing values and normalize the data. The training and testing sets are split, and a sequence of data points is created for input to the LSTM model.
The LSTM model architecture comprises multiple layers of LSTM cells with dropout for regularization. The model is designed to learn from historical patterns in the data.
The model is trained using the training set, and the training process is optimized using the Adam optimizer. The number of epochs and batch size are configurable parameters.
The trained model is backtested on historical data to simulate its performance in a real trading scenario. Buy/sell signals are generated based on predicted price changes, and the portfolio value is calculated.
The project evaluates the model's performance using various metrics, including gross profit, net profit, win rate, max drawdown, and more.