Skip to content
All library documents

Using UMAP Regression to Discover Candlestick Patterns

Article MQL5 articles

Summary

This article describes a machine learning workflow for representing single-candle market data with UMAP, a nonlinear dimensionality reduction method. It builds ten features from price changes over a chosen horizon and from the candle’s open, high, low, and close relationships. UMAP compresses those features into embeddings intended to group similar candles and expose patterns that traders may not have specified in advance.

The article reports training two models to forecast EURGBP daily returns: one using the original features and one using UMAP-reduced data. In the example, three embeddings produced lower forecast error than the original ten dimensions. It then approximates UMAP’s embeddings with a neural network for use in a trading system, and reports a backtest with a Sharpe ratio of 0.42, positive expected payoff, 64% profitable trades, and 25 trades. Average holding time was about 54 days, suggesting the system captured sustained moves.

These are results from one market and one example, not evidence of general profitability. The described features identify single-candle patterns only; multi-candle formations are outside the method’s scope. The article also notes that library implementations may differ in numerical behavior.

Key ideas

  • UMAP can compress engineered candle features while representing nonlinear relationships.
  • The example uses ten price-based features to describe individual candles.
  • A model trained on three UMAP embeddings reportedly improved forecast error over the original features in the EURGBP example.
  • A neural network approximates UMAP embeddings so they can be used in the trading system.
  • The backtest suggests trend capture, but its small, single-market sample limits broader conclusions.

Tags

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