Skip to content
All library documents

Property-Aware Contrastive Transformers for Candlestick Pattern Forecasting

Article MQL5 articles

Summary

This article describes the property-aware attention component of an Atom-Motif Contrastive Transformer for forecasting market patterns. It treats candlesticks as atomic observations and larger chart patterns as motifs, then uses contrastive learning to distinguish informative patterns across timeframes or instruments. Instead of defining market properties such as trend strength by hand, the proposed module learns task-specific property embeddings from training data.

The implementation outline builds those embeddings with trainable layers, processes them through relative self-attention, cross-attention to pattern inputs, and residual convolution blocks, and overrides feed-forward and gradient routines to handle the two input streams. The article situates this component within a broader MQL5 model implementation and reports testing on historical data. The authors say the resulting model traded infrequently, while suggesting that the approach merits further study. No detailed performance statistics, benchmark comparison, or evidence of profitability are provided, so the account supports architectural understanding rather than conclusions about trading effectiveness.

Key ideas

  • The framework represents market behavior at both candlestick and multi-candle pattern levels.
  • Contrastive learning is used to separate more informative patterns from less useful ones.
  • Task-specific market properties are learned as embeddings rather than supplied as manually defined labels.
  • Relative self-attention and cross-attention connect learned properties with pattern representations.
  • The reported historical test produced sparse trading activity and does not establish profitability.

Tags

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