Discussing the article: "Trading Robot Based on a GPT Language Model"

 

Check out the new article: Trading Robot Based on a GPT Language Model.

The article presents a complete implementation of TimeGPT, a specialized Transformer-based architecture for forecasting financial time series on the MetaTrader 5 platform. Adaptation of the attention mechanism to financial data, selective tokenization of price changes, hardware-aware optimizations, and advanced learning techniques are discussed. Included are practical testing results showing 87% forecast accuracy over a 24-bar horizon with a training time of 15 minutes on the CPU. We also present a ready-made trading EA with automatic retraining.

Before diving into the code, it is important to understand what TimeGPT works with. Financial markets produce data in the form of time series — a sequence of prices recorded at regular intervals, such as every hour. Market prices do not follow simple rules: they can skyrocket on news, slowly fall, or fluctuate for no apparent reason. TimeGPT's job is to find patterns in this data and predict how the price will change in 24 hours, which in market charting terms is called 24 bars.

Developing a model requires solving several problems. First, we need to determine how to store and process price data. Then we need to convert this data into a format the model can understand. Next, we need to design the model architecture so that it can find complex dependencies in the data. The model is then trained on historical data to learn how to make accurate predictions. Finally, it is important to optimize the model so that it runs quickly and does not require too much memory, given the limitations of the MetaTrader 5 platform. Now let's look at each of these steps, using the code from the TimeGPT_Fixed.mqh file.


Author: Yevgeniy Koshtenko

 
Evgeny, thank you! It would be nice to see a similar solution for a good, modern graphics card.
 
There’s no backprop, I take it? The weights remain the same as at initialisation.