Discussing the article: "Training a nonlinear U-Transformer on the residuals of a linear autoregressive model"

 

Check out the new article: Training a nonlinear U-Transformer on the residuals of a linear autoregressive model.

The article presents an innovative hybrid system for forecasting exchange rates that combines a linear autoregressive model with a U-Transformer architecture for residual analysis. The system automatically switches between signal sources depending on their quality and includes complete trading logic with averaging/pyramiding strategies. The key advantage of this approach is that the neural network is trained on the residuals of the linear model, which simplifies the task and reduces the risk of overfitting. The implementation is done entirely in MQL5 and is ready for use in real trading with automatic adaptation to changing market conditions.

The EA from the article about regression models was used as a basis with the addition of the hybrid model. 

Let us examine the model’s performance on EURUSD M15, for the period starting July 1, 2025:

The Sharpe ratio turned out to be quite good:


Author: Yevgeniy Koshtenko

 
The balance chart does not show any averaging or pyramiding, as claimed, because these would result in a sawtooth-shaped deposit history histogram.