BlogOctober 19, 2025Naming a market regime toolkit after two mathematicians
I've been working on a side project analysing market regimes in financial time series,
and I finally put it together into something shareable. I named it after Gaston Julia and
Benoit Mandelbrot, two mathematicians whose work on fractals shaped the approach.
The reason is not decoration. Julia sets show self-similar patterns at every scale, and
market behaviours repeat across timeframes in much the same way — what a chart looks like
at one resolution often rhymes with what it looks like at another. Mandelbrot's argument
went further: markets are chaotic and fractal, not the neat bell curves we would prefer
them to be. Returns have fat tails. Extreme events happen far more often than a normal
distribution predicts, and building on the assumption that they don't is how models fail
at exactly the moment you need them.
So the toolkit takes that seriously. It classifies six market states — bull, bear, and
sideways, each either volatile or quiet — and it uses fuzzy logic rather than hard
thresholds, so a series sitting between two regimes is reported as ambiguous instead of
being forced into a category it doesn't belong in. It tracks how regimes transition over
time using Markov chains, and it computes the Hurst exponent to distinguish genuinely
persistent trends from mean-reverting noise.
What it does not do is tell you what to trade. There are no entry rules, no exit rules,
no position sizing. That boundary is deliberate: regime classification is an input to a
decision, not the decision, and tools that blur those two tend to get trusted more than
they have earned.
It's open source and still a work in progress.
View the project on GitHub