Skip to content
All library documents

SAX Encoding for Historical Price Analogs and Forecasting

Article MQL5 articles

Summary

The article explains Symbolic Aggregate Approximation (SAX) for converting price windows into compact symbolic sequences. It first normalizes each window to emphasize shape, averages values within equal segments, then maps those averages to symbols using equal-probability Gaussian breakpoints. The resulting words support fast comparisons, and the SAX MINDIST measure provides a lower bound on distance between the underlying normalized series, allowing distant candidates to be pruned safely before detailed ranking.

The proposed application searches earlier market windows for analogs of current conditions, then summarizes their forward outcomes in a forecast cone and verdict panel. The design includes a guard against future leakage and scales outcomes by prevailing volatility; it can withhold a directional verdict when the analog evidence does not indicate an edge. The article describes a validation harness for mathematical properties, but the supplied material does not provide evidence of profitable live trading. Normalization intentionally removes price level and volatility, so the method’s forecasts remain conditional historical comparisons rather than reliable predictions.

Key ideas

  • SAX compresses normalized time-series windows through averaging and Gaussian-based symbol assignment.
  • The MINDIST comparison can safely prune candidates because it lower-bounds distance in the underlying series.
  • The analog search ranks historical windows and evaluates their subsequent outcomes in volatility-scaled units.
  • A no-lookahead guard and a no-edge verdict are included to limit misleading forecasts.
  • Normalization discards price level and volatility, which constrains how analogs should be interpreted.

Tags

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