Skip to content
All library documents

Implementing Layered Memory and Attention in a Trading Agent

Article MQL5 articles

Summary

This article implements a version of the FinMem trading-agent architecture in MQL5. Its memory design separates short-term market information from longer-lived patterns or strategies. The described neural module processes market-state tensors and account information through memory components and cross-attention blocks, then uses recent actions and account outcomes as context for producing the next action. The article also discusses preserving intermediate outputs so that the custom network’s backpropagation can use them.

The implementation is explicitly an interpretation of the original framework and omits its large language model, so it does not reproduce the full FinMem system. The text reports favorable experimental behavior and suggests potential for trading use, but the supplied account gives limited detail about datasets, metrics, or comparisons, making the claims difficult to assess from this article alone. It acknowledges the need for further tuning, representative training data, and thorough testing before live deployment. The material is most useful as an architectural example of memory and attention modules, rather than evidence that this agent reliably improves trading decisions.

Key ideas

  • The design separates short-term market inputs from information intended to persist longer.
  • Memory modules and cross-attention combine market state, account data, and recent agent actions.
  • Intermediate action outputs are retained to support the model’s gradient calculations.
  • The MQL5 implementation omits the large language model in the original FinMem concept.
  • Reported experiments lack enough detail here to establish live trading reliability.

Tags

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