Model prediction for today:

Date (Hong Kong time): 2024-01-29

Opening: 305.38 High: 311.98 Low: 299.17 Closing: 306.11

According to the test results, if you open a 20x leverage and go long at the predicted lowest price on the day, the probability of your position being liquidated is only 1%, and if you go short at the predicted highest price on the day, the probability of your position being liquidated is only 6%!!!

Basic principles of LSTM

LSTM (Long Short-Term Memory) is a special type of recurrent neural network (RNN) designed to solve the gradient vanishing or exploding problem encountered by traditional RNN when processing long sequence data. It controls the flow of information by introducing three gates (forget gate, input gate, and output gate) and a memory unit, which enables LSTM to effectively save and access long-term dependency information. The structure of these gates enables LSTM to flexibly add or forget information, thereby more effectively capturing long-term dependencies when processing sequence data (such as text or time series).

In short, we can use LSTM neural networks to predict future results by learning from historical data.

Model building process

data set

The data of this model comes from OKX's API, which may be slightly different from Binance's contract price. I have collected data on the $BNB contract mark price for nearly a year (402 days), based on Hong Kong time, with the daily opening time at 00:00 and the daily closing time at 24:00, covering a time span from 2022-12-23 to 2024-01-28.

data set

Training process

The price data of the past 10 days is used as input and the price data of the 11th day is used as output to train the neural network. 80% of the data set is used as the training set and 20% as the test set.

forecast result

In general, the opening price is the most accurate prediction, but the opening price is actually not very meaningful, because the closing price of the previous day is basically the opening price of the next day, and the closing price is the least accurate. According to different error rates, the accuracy is as follows:

The prediction accuracy with an error rate of 1.0% is: {'open': '0.90', 'high': '0.53', 'low': '0.48', 'close': '0.42'}

The prediction accuracy with an error rate of 2.0% is: {'open': '1.00', 'high': '0.75', 'low': '0.78', 'close': '0.65'}

The prediction accuracy with an error rate of 3.0% is: {'open': '1.00', 'high': '0.85', 'low': '0.94', 'close': '0.72'}

The prediction accuracy with an error rate of 4.0% is: {'open': '1.00', 'high': '0.90', 'low': '0.96', 'close': '0.85'}

The prediction accuracy with an error rate of 5.0% is: {'open': '1.00', 'high': '0.94', 'low': '0.99', 'close': '0.87'}


The accuracy is calculated by the fact that the actual price is within the range of the predicted price ± the error rate, which means that the prediction is accurate. For example, a 5% error rate means that the probability that the actual price is within the range of the predicted price ± 5% can be found. The accuracy of the highest price is 94%, and the accuracy of the lowest price is 99%.

In other words, if you open a 20x leverage and go long at the lowest predicted price on the day, the probability of your position being liquidated is only 1%, and if you go short at the highest predicted price on the day, the probability of your position being liquidated is only 6%!!!

Of course, the above data is for reference only and does not constitute investment advice. After all, there are so many black swans and the market is so volatile, DYOR! If you want future forecast data, please pay attention and forward it. If you forward it more than 100 times, I will publish the forecast data on the square and X!

Opening price forecast fit (orange is forecast, blue is actual)
Highest price forecast fit (orange is forecast, blue is actual)
Lowest price forecast fit (orange is forecast, blue is actual)
Closing price forecast fit (orange is forecast, blue is actual)