Discussing the article: "Shape of Price: An Introduction to TDA and Takens Embedding in MQL5"

 

Check out the new article: Shape of Price: An Introduction to TDA and Takens Embedding in MQL5.

The article presents a practical foundation for shape analysis of price series in MQL5. It implements Takens time‑delay embedding to build a phase‑space point cloud and computes the full pairwise distance matrix under selectable norms. The CTDAPointCloud and CTDADistance classes are provided with a demo script that embeds chart data and outputs results, preparing inputs for downstream topological tools.

This first article does not yet trade. It does not yet produce a persistence diagram. It builds the two classes that turn a one-dimensional price series into a cloud of points in higher-dimensional space and equips that cloud with a notion of distance. Those are the inputs the rest of the library consumes.

Two scatter plots side by side: the trending window forms an elongated curved cloud, the ranging window forms a tight cluster


The diagram above sketches the idea before any code. It contrasts two windows of the same length embedded into three-dimensional phase space. The left cloud stands for a trending window, where price drifts in one direction with small mean-reverting steps. The right cloud stands for a ranging window, where price oscillates inside a narrow band. Two such windows can be tuned to share almost identical means and volatilities, yet their point clouds do not look similar at all.

The trending cloud stretches out along a curved arc. The ranging cloud collapses onto a tight, near-circular tangle. A persistence calculation on each would assign them very different topological signatures. A standard indicator that only saw the closing prices would assign them very similar readings.

That is what this article delivers. The rest of it explains how.



Author: Hammad Dilber