Skip to content
All library documents

Graph Transformer Encoders for Trading Agent State Representations

Article MQL5 articles

Summary

The document adapts ideas from a graph transformer generative model, originally developed for architectural layouts, to trading-agent representation learning. Its encoder combines transformer attention, which can represent broad relationships, with graph convolution, which models local connections. Separate attention modules handle connected and unconnected nodes, and a graph modeling block refines local structure. In the original layout task, nodes represent rooms and edges represent adjacency; the trading application instead uses the encoder to represent environment states and inform agent actions.

The article describes pretraining by masking nodes and edges and reconstructing the missing graph structure, then implementing the encoder in MQL5 and testing it with trading data. It reports that the resulting experiments need further work: the replay data contained few positive passes, and the learned policy remained close to the training sample average without producing positive results. Thus, the article offers an architecture and implementation attempt rather than evidence of a successful trading strategy. Its transfer from layout generation to trading is experimental, and the reported data imbalance limits the conclusion.

Key ideas

  • The encoder combines attention over graph relationships with graph convolution for local structure.
  • Separate attention modules model relationships among connected and unconnected nodes.
  • Randomly masking nodes and edges creates a reconstruction task for learning graph representations.
  • The article applies this encoder concept to trading-agent state representations in MQL5.
  • Its reported trading experiments were inconclusive, with few positive examples in replay data and no positive result.

Tags

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