Discussing the article: "Symbolic Aggregate Approximation (SAX) in MQL5: Historical Analog Search and Forecasting"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Symbolic Aggregate Approximation (SAX) in MQL5: Historical Analog Search and Forecasting.
Symbolic Aggregate approXimation (SAX) encodes price windows as short words to enable fast, sound similarity search on history. We implement SAX in pure MQL5, including Gaussian breakpoints, PAA, and the lower-bounding MINDIST, and validate it with a test harness. An indicator applies a no-lookahead, two-stage search, summarizes forward paths in ATR units, and draws a forecast fan, explicitly indicating when the sample shows no edge.
Every chart you have ever looked at is a stream of numbers, and almost every tool we build to read it stays in the world of numbers: moving averages, oscillators, regressions, neural networks. There is an older, quieter idea from the time-series mining literature that does something different. It stops treating them as numbers. It takes a window of price, and turns it into a short string of letters, something like bddcbbba. Once a piece of the market is a word, you can do to it everything computer science already knows how to do with text: match it, count it, hash it, search it. That transformation is called Symbolic Aggregate approXimation, or SAX, introduced by Jessica Lin, Eamonn Keogh and colleagues in 2003; their original SAX page collects the papers and is well worth reading.
SAX has been used for fast similarity search, motif discovery, anomaly detection and classification across many scientific fields. In finance it is far less common, and there is an honest reason for that which we will confront head-on rather than hide: the very step that makes SAX elegant, its normalization of each window so only its shape matters, deliberately discards the price level and the volatility, and in trading those are often exactly the information you care about. A method designed to treat any signal alike does not automatically respect what makes a market a market.
This article is not a sales pitch for a magic indicator; it has two goals. First, it implements SAX in pure MQL5, including the Gaussian breakpoints and the lower-bounding distance used for sound search. These primitives are not yet available on the platform. Second, it applies SAX to a practical question: the market is doing this now; when has it behaved similarly before, and what followed? We answer that with an analog-search tool that draws a forecast cone into the future and a verdict panel that reports the statistics behind it. The tool is designed to avoid overclaiming: it withholds forecasts in coin-flip cases, measures outcomes in a volatility-robust way, and prevents any future leakage into the precedent set.
Author: Muhammad Minhas Qamar