Skip to content
All library documents

A Reversible Normalization Layer for Time-Series Forecasting in Trading Models

Article MQL5 articles

Summary

This article explains Reversible Instance Normalization (RevIN), a method for handling distribution shifts in time-series forecasting. For each input sequence, the method removes its mean and scales by its standard deviation so a model can focus on local dynamics in a more consistent representation. A corresponding output step uses the same statistics to restore forecasts to the input sequence’s original scale and location. The article describes normalization and denormalization as paired layers, especially suited to symmetric input and output positions in an encoder-decoder model.

The practical section adapts the method in MQL5 by reusing a batch-normalization layer for input processing and implementing a separate denormalization layer that refers back to the normalization statistics. The broader motivation is to train an encoder to predict future environment states before using those representations to train downstream policy models, avoiding conflicting gradients from multiple tasks. The author reports tests on historical data and unseen data, with profitable outcomes, but supplies no quantitative results in the excerpt. The programs are explicitly demonstrations, so the claims do not establish general trading performance.

Key ideas

  • RevIN normalizes each input sequence using its own mean and standard deviation.
  • A paired denormalization step restores model outputs using the statistics gathered from the input.
  • The method is intended to reduce the effects of non-stationary distributions in time-series forecasting.
  • In the described MQL5 design, the denormalization layer reuses statistics from the normalization layer rather than learning separate ones.
  • Reported trading tests are demonstrations without quantitative performance details.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.