Discussing the article: "Foundation Models in Trading: Time Series Forecasting with Google's TimesFM 2.5 in MetaTrader 5"
I'm not an expert in the area, this is why it's unclear how you feed vectors with 40+ features into TimesFM, which is supposedly univariate (1 feature per point)? Is it hidden behind patching or adapters? Neither disclosed in the article.
Also, if I understand correctly, you train and forecast every instrument independently. Will it be more appropriate to feed all the features for all instruments to predict future horizon of every instrument? Market is a whole system, where every instrument affects the others.
I'm not an expert in the area, this is why it's unclear how you feed vectors with 40+ features into TimesFM, which is supposedly univariate (1 feature per point)? Is it hidden behind patching or adapters? Neither disclosed in the article.
Also, if I understand correctly, you train and forecast every instrument independently. Will it be more appropriate to feed all the features for all instruments to predict future horizon of every instrument? Market is a whole system, where every instrument affects the others.
point, quantiles = model.forecast_with_covariates( inputs=[close_context], # the univariate series dynamic_numerical_covariates=dynamic_numerical, # the 40+ features static_categorical_covariates={...}, xreg_mode="xreg + timesfm", )
- TimesFM proper sees only the close series, patched and fed through the decoder transformer as designed.
- xreg path takes the covariates and fits a separate regression component (in TimesFM's xreg implementation this is essentially a linear/ridge model over the covariates, fit on the in-context window).
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: Foundation Models in Trading: Time Series Forecasting with Google's TimesFM 2.5 in MetaTrader 5.
Time series forecasting in trading has evolved from traditional statistical models (like ARIMA) to deep learning approaches, but both require heavy tuning and training. Inspired by advances in NLP, Google’s TimesFM introduces a pretrained “foundation model” for time series that can perform strong forecasts even without task-specific training. For traders, this is powerful because it can be efficiently fine-tuned on their own data using lightweight methods like LoRA, reducing overfitting while adapting to changing market conditions.
In the natural language processing domain, we have witnessed a paradigm shift: large foundation models, pretrained on vast corpora and then adapted to specific tasks, have displaced the "train from scratch" workflow. The question naturally arises: can this transfer learning revolution work for time series?
Google Research answered this affirmatively with TimesFM (Time Series Foundation Model), introduced in the paper "A decoder-only foundation model for time-series forecasting" and accepted at ICML 2024. TimesFM is a 200-million-parameter, decoder-only transformer pretrained on 100 billion real-world time points. Despite being much smaller than contemporary LLMs, it achieves strong zero-shot performance across domains and granularities. In many cases, it matches or outperforms supervised models trained on the target datasets.
This is particularly useful for algorithmic trading because it can be fine-tuned on proprietary financial data. Using PEFT with LoRA adapters, we can specialize TimesFM for specific instruments while keeping trainable parameters below 100K. This helps reduce overfitting on non-stationary market data.
In this article, we build a complete end-to-end pipeline that:
Author: Seyedsoroush Abtahiforooshani