This repository contains code for predicting stock prices using Long Short-Term Memory (LSTM) neural networks. The project leverages technical indicators and time series data to forecast future stock prices.
The project involves the following steps:
- Data Preprocessing: Load and clean the data, convert volumes, and set the date as the index.
- Feature Engineering: Add technical indicators such as SMA, EMA, and RSI to the dataset.
- Scaling: Normalize the features and target variable using MinMaxScaler.
- Data Splitting: Split the data into training and test sets using TimeSeriesSplit.
- Model Building: Construct and compile an LSTM model with Bidirectional LSTM layers and Dropout.
- Model Training: Train the model using early stopping to prevent overfitting.
- Prediction: Make predictions on the test set and future prices, ensuring the price change is within a specified range.
- Evaluation: Evaluate the model performance using MAE, MSE, and RMSE, and visualize the results.
Ensure you have the following libraries installed:
- pandas
- numpy
- matplotlib
- scikit-learn
- tensorflow
- ta (Technical Analysis Library)
You can install the required libraries using pip:
pip install pandas numpy matplotlib scikit-learn tensorflow ta