Skip to content
All library documents

Adapting Traj-LLM Components for Financial Trajectory Forecasting

Article MQL5 articles

Summary

This article describes Traj-LLM, a framework originally designed to predict autonomous vehicle trajectories, and adapts its components to financial time-series forecasting. It combines sparse joint encoding of agent and scene features, high-level interaction modeling with a pretrained GPT-2 transformer and LoRA fine-tuning, lane-aware probabilistic learning using a Mamba state-space layer, and a multimodal Laplace decoder. The article explains how attention mechanisms fuse agent and lane information and how parameter-efficient tuning can reduce the need to retrain an entire language model.

The practical section discusses an MQL5 implementation and training on historical market data. The reported test produced a 13.6% profit and a 1.19 profit factor, alongside an equity drawdown of nearly 33%. The author considers the results insufficient for real-world trading and in need of improvement. The evidence is limited to the described test; the article does not establish robustness across markets or conditions, and its financial architecture is the author's interpretation of a method developed for traffic prediction.

Key ideas

  • Traj-LLM encodes local relationships between agents and lanes before passing the representation to a pretrained language model.
  • The framework uses frozen transformer weights with LoRA adapters to model high-level interactions efficiently.
  • A Mamba layer estimates the relevance of candidate lane information over time.
  • The article adapts the architecture to financial forecasting and describes an MQL5 implementation.
  • The reported test results include substantial drawdown, so the author does not consider the model ready for live trading.

Tags

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