Skip to content
All library documents

TimeFound: Multiscale Transformer Forecasting for Adaptive Trading

Article MQL5 articles

Summary

This article presents TimeFound, a Transformer framework for forecasting time series across domains, and discusses how it can inform systematic trading. The model represents data at multiple time scales by splitting histories into patches of different lengths. Separate projections process those scales, while masks distinguish valid observations from padding. Its encoder uses bidirectional self-attention over historical tokens; a decoder uses causal attention and encoder context to generate forecasts autoregressively, one token at a time.

The trading implementation adapts the forecasting architecture into a position-management system that reassesses each new bar and can hold, close, reverse, or increase a position. The article describes training and testing with historical data and reports positive returns on January 2025 market quotes, alongside substantial drawdowns. This is a limited demonstration rather than evidence of robust live performance: the model requires further risk-management work, and the article itself cautions that the programs are not ready for real-world trading. Its claims do not establish generalization across assets or market regimes.

Key ideas

  • TimeFound uses patches of varying lengths to represent patterns at multiple time scales.
  • Separate projection modules and validity masks help handle differing input lengths and missing or padded observations.
  • The encoder processes historical tokens bidirectionally, while the decoder generates forecasts sequentially with access to encoder context.
  • The described trading system updates its position decision on each new bar instead of relying on a distant fixed forecast.
  • The reported January 2025 test had positive returns but deep drawdowns, so risk controls and broader evaluation remain necessary.

Tags

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