Discussing the article: "Time Series Shapelets: Learning a Price Shape, and Testing Whether It Means Anything"
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: Time Series Shapelets: Learning a Price Shape, and Testing Whether It Means Anything.
We implement a Time Series Shapelet library for MQL5 that finds the subsequence of price history whose z-normalized shape best separates two labels and derives the decision threshold from information gain. Because candidate searches on prices always return a winner, the fit includes a purged hold-out and a calibrated block permutation null. You get a reusable facade and rules you can plot and evaluate against an explicit noise floor.
A shapelet is two objects, and keeping them separate is the whole game. The first is a shape: a short subsequence, z-normalized so that only its form matters and not its price level or its volatility. The second is a distance threshold. Together they form a decision stump: measure how far a window sits from the shape, and if that distance is at or below the threshold, predict one class, otherwise the other.
The distance between a shapelet and a longer window is the minimum over all placements. Slide the shape along the window, z-normalize both at every position, take the Euclidean distance, keep the smallest. That answers "how well does this shape fit anywhere in this window", which is exactly the question a pattern is supposed to answer.
The figure below shows both halves on a synthetic dataset where a shape genuinely exists. On the left the learned shape is drawn over the window position where it fits best; on the right every window sits on the distance axis colored by its true class, with the chosen threshold dashed. The separation on the right is the reason the shape on the left is worth looking at.
Author: Hammad Dilber