For most of the last decade I treated market data as a sequence problem. Rows of trades, a rolling window, a model that predicts the next value. Every version of that pipeline eventually behaved the same way: it fit the training window beautifully and then decayed the moment the market changed character.
The change I want to write about is small to state and large to live with. A price series is not only a sequence. It is also a curve, and a curve has local shape that does not depend on when you started looking at it.
Why the sequence framing decays
A sequence model learns a mapping from a window of values to the next value. When the market changes regime, the mapping does not just get noisier, it becomes the wrong function. Feature engineering papers this over by adding more features, which mostly adds more ways to be wrong at the same speed.
What I wanted was a description whose components stay meaningful when the market turns: something that tells me the path is bending, not that the next price will be 4 basis points lower.
The curve framing
Sample the order book at a fixed cadence and you get a point per interval in a space whose coordinates are liquidity-sensitive aggregates. Connect the points and you have a polyline. Smooth it and you have a curve. Now the classical machinery applies.
For a curve parametrised by arc length, the Frenet-Serret frame gives an orthonormal basis at every point, and two scalar fields:
Curvature says how hard the path is turning. Torsion says how much it is leaving the plane it was travelling in. Both are invariant to translation and rotation, which is exactly the property a descriptor of market state should have.
The descriptor as a state summary
The useful object is not a single number. It is the pair of trajectories over a window, summarised into a small vector. Two windows that produce similar summaries are, by construction, in similar states regardless of the absolute price level.
// Arc-length resample, then central differences for the first three derivatives.
var samples = ResampleByArcLength(points, targetCount: 256);
var d1 = CentralDifference(samples, order: 1);
var d2 = CentralDifference(samples, order: 2);
var d3 = CentralDifference(samples, order: 3);
var curvature = d2.Select(v => v.Length);
var torsion = Enumerable.Range(0, samples.Count)
.Select(i => TripleProduct(d1[i], d2[i], d3[i]) / Math.Pow(d2[i].LengthSquared, 2))
.ToArray();
The first version of this leaked badly. The resampling step used the window’s own mean, so the descriptor quietly encoded the price level, and the ablation in the next entry is the result of chasing that down.
What this gives the rest of the work
Three things, in the order I actually got them.
- A descriptor that survives regime change, because it describes shape rather than level.
- A reason to care about the geometry of the order book rather than the geometry of the price chart.
- A testable claim. If geometry is doing real work, then removing it should hurt more than removing any engineered feature. That claim is what the ablation study was built to break.
Cite this entry
Copy the block you need.
@misc{huang2026fromsequencestotra,
author = {Mr Huang},
title = {From Sequences to Trajectories: My Research Journey Begins},
year = {2026},
url = {https://selfevo.dev/en/research/logs/from-sequences-to-trajectories},
note = {selfevo, research}
} TY - GEN
AU - Mr Huang
TI - From Sequences to Trajectories: My Research Journey Begins
PY - 2026
UR - https://selfevo.dev/en/research/logs/from-sequences-to-trajectories
PB - selfevo
ER - Mr Huang (2026). From Sequences to Trajectories: My Research Journey Begins. selfevo. https://selfevo.dev/en/research/logs/from-sequences-to-trajectories