-
Notifications
You must be signed in to change notification settings - Fork 0
Home
In this case, we are trying to predict what is going to be the high value for the next time frame. In order to do this, we take a dataset using the Binance API we scrap it and then train our model to make the predictions.
First, we read the dataset:
The dataset looks like this:
We drop the unnecessary columns and change the dataset to numeric:
The dataset looks like this:
Get the Y and scale the values:
We build the train and test values for the model, in this case the latest 200 rows will be the test. We also prepare the X values for the LSTM model, we take groups of two.
Define and train the model:
Get predictions and plot them:
Plot:
Get the loss of the model and plot the train and test loss:
As we can see, the model fits correctly as the train and test loss goes down. The problem becomes later because we can fit more or less the next high values, but predicting them is like predicting the lottery, it is almost impossible. So in conclusion, you can fit a model precisely to predict the next high value, but the results will almost never be precise enough to be useful in market predictions.