Daily close Prediction of gold Using LSTM & XGB.
The dataset is taken from yahoo finace's website in CSV format. The dataset consists of Open, High, Low and Closing Prices of gold from 2nd january 1996 to 30th July 2021 - total 6660 rows.
We added some famous technical indicators such as RSI, ROC, Bollinger Bands, etc.
After converting the dataset into daily close, it becomes one column data. This has been converted into multi column time series data. All values have been normalized between 0 and 1.
Two/Three sequential LSTM layers have been stacked together and one dense layer is used to build the RNN model using Keras deep learning library. Since this is a regression task, 'linear' activation has been used in final layer.
Python 3.7 and latest versions of all libraries including deep learning library Keras and Tensorflow.
75% data is used for training. Adagrad (adaptive gradient algorithm) optimizer is used for faster convergence.
Test accuracy metric is root mean square error (RMSE).
Go to lstm.py
In lstm_predict.py a bot is created when everynight we try to predict tomorrow daily close & the signal will be sent to a telegram channel.