Skip to content
All library documents

Adapting Atom-Motif Contrastive Learning to Candles and Price Patterns

Article MQL5 articles

Summary

The article adapts the Atom-Motif Contrastive Transformer, originally developed for molecular data, to trading inputs. It treats individual candles as low-level elements and recurring candle formations as motifs, encoding each sequence through a separate pathway. The proposed training combines prediction loss with alignment between the two representations and contrastive learning that encourages matching motifs across examples to have similar embeddings. A property-aware attention decoder is intended to identify which motifs matter for a prediction.

The practical discussion focuses on implementing the architecture in MQL5, including an OpenCL kernel to calculate alignment gradients for both pathways together. It explains why the pathways should share an activation function so their outputs are comparable. The article is an implementation-in-progress: it does not report completed training results, market tests, or evidence of predictive advantage, and says evaluation on historical data will follow in a later installment. Its trading application is therefore a proposed modeling approach, not a validated strategy.

Key ideas

  • The model represents market data at both candle and recurring-pattern levels.
  • Alignment loss brings candle and motif representations of the same sample closer together.
  • Motif contrastive loss encourages recurring patterns to have consistent representations across samples.
  • Property-aware cross-attention is intended to highlight motifs relevant to a prediction.
  • The MQL5 implementation is incomplete and the article presents no trading performance results.

Tags

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