What is LSTM in the first place. Chapter 1: Complete explanation of LSTM (Chapter 1: Basics and Mechanism)
Good evening. This is OQ Customer Staff. Since a major update has been released by the developers, this time, together with me, let's study a little about LSTM.
By the way, before we get into the story of LSTM, while trading, everyone has thought at least once, "It would be nice if I could see the future.".
I am actually one of those people.
In statistics and probability, the higher the probability, the more likely you are to predict future events accurately, as you all know.
For example, light a piece of paper. Then, how do you predict what will happen to the paper a few minutes later?
The probability of it burning is 99.9%, right? We do not evaluate the number 100% because we believe the world is composed of uncertain elements.
For instance, the moment after you light the fire, the world might become a vacuum for a few seconds. Therefore, it is not guaranteed that the paper will burn 100%.
That's right. So, no one can know the future.
However, going back, the higher the probability, the easier it is to predict future events.
In fact, this is the same for both humans and AI. But as you all know, the difference between humans and AI is that AI does not have any mental biases in its predictions.
So, how does AI predict the future?
Sorry to keep you waiting. Here is the main topic.
The machine learning model that AI uses to predict the future is called "LSTM."
First, LSTM (Long Short-Term Memory) is
a special neural network designed to handle time-series data.
Time-series data, in simple terms, is
・Technical charts such as FX and stocks.
Ordinary neural networks (fully connected layers) are strong with “single inputs,” but
they are weak for data with a “flow of time” as shown below.
- Currency exchange (e.g., XAUUSD)
- Stock prices
- Sound
- Text (sentences)
- Sensor time-series
That is why what is useful here isRNN (Recurrent Neural Network)
RNN Recurrent Neural Network is
RNNs compute while carrying over “past information.”
x(t-2) → h(t-2)
↓
x(t-1) → h(t-1)
↓
x(t) → h(t)
↑ In terms of a formula, it uses this kind of calculation.
In simple terms, they "return to the original state while remembering things." Therefore, they are strong for learning time-series data like FX.
Normal neural networks
learn by repeating inputs to outputs.
Recurrent neural networks
input → past memory → output
↑ Therefore, they excel at learning chart patterns of FX or stock investments to predict future charts.
However, there is a fatal problem here.
RNN (Recurrent Neural Network) has
Vanishing Gradient
As time grows...
A decisive problem where past information gradually vanishes.
In other words, if you train on 100 candlesticks, what you learned becomes zero.
It's like a cat that forgets everything after walking three steps.
This is useless for anything.
That is where the problem was solved by the aforementioned "LSTM."
Put simply, the crucial difference between RNN and LSTM is that “what to forget and what to remember” became possible.
In other words, it has become closer to the human brain.
As a side note,
In the field of neuroscience, human memory is that everything you have ever learned is actually remembered. Forgetting or being unable to recall is like a chest of drawers sticking and not being able to pull out the memory; it just does not come out.
Back to the topic, AI is not yet that close to humans, and when learning, it learns by making choices and selections.
In other words, LSTM is the cutting-edge technology in modern neural networks, machine learning, and AI fields.
Now, how can this be applied to trading?
① Learn the continuity of patterns
② Quantify human intuition, evaluate it, and make future predictions possible
These are my two assumptions.
I have an acquaintance who has traded professionally for decades, and he said, “The final answer is that trading, in the end, becomes a matter of the price movement’s tendencies, and you can tell the next move.”
That person has faced charts for over 100,000 hours, it seems, but that vast amount of experience can be learned by AI in an instant with LSTM, or more broadly, machine learning.
What a great era we live in.
Now, next time, we will explain TesolFlow, the decisive factor of LSTM.
Well then, see you next time.