I have an assignment to create a LSTM network predicting price and trend of cryptocurrencies based on stock market data from the past.
The network I am using is a multilayered LSTM, where layers are stacked on top of each other. I provide keras code for the model below:
model = keras.Sequential() model.add(LSTM(input_shape=(720, 4,), units=32, return_sequences=True, use_bias=True)) model.add(LSTM(units=64, return_sequences=True, use_bias=True)) model.add(Dense(units=32, use_bias=bias, activation="linear")) model.add(Dense(units=1, use_bias=bias, activation="linear"))
I use SGD optimizer, but I have also tried Adam and RmsProp. My loss function is mean squared error. As input I am providing 720 samples of stock prices with 1h intervals, sales volume, and two moving averages of prices over different number of samples. Input data is taken from stock price history of different cryptocurrencies. The output is supposed to be stock price 10 time units in the future.
The predictions are pretty bad, the network seems to just randomly choose some nuber that is close to the last price in series. My profesor expects the predicted price to be trending in the right direction about 70-80% of the time and it is definitely not the case here.
Am I doing something wrong? Is the network architecture all wrong, or do I use LSTM network incorrectly? Or maybe I should provide the network with some additional data? I have already tried changing number of units in each layer in range from 10 to 100, I have also changed the number of LSTM layers between 2-4, and there was no noticeable improvement.
If someone could provide any pointers on how to proceed I would be very grateful.