 # The coastline paradox and the fractal dimension of markets

Coastlines are fractal curves. When you zoom in, you will see similar shaped curves on every scale. The same is true for market data. On a naked chart you can hardly tell if it is a daily or hourly chart. This article will explore this feature of crinkly curves and show how much markets and coastlines have in common.

## The coastline paradox

When trying to measure the length of the British coastline you will quickly notice, that the length measured depends on the length of the ruler you use. The shorter the ruler, the longer the measured length of the coastline.

When measuring a straight line, the length of the ruler has no influence. You can measure 1 meter with a 1cm ruler applied 100 times or with a 50cm ruler applied 2 times. Both methods will give you the same result. Not so when measuring a crinkly line like a coast. British coastline length paradox (c) wikipedia

In 1967 Benoit Mandelbrot wrote a famous article in Science magazine about this problem. This was the birth of fractal geometry. The basic assumption was, that if a curve is self similar, this self similarity can be described by the fractal dimension of a curve. Self similarity means, that if you zoom into a curve, it looks similar on all zoom levels.

## Coastline paradox in financial markets

If you would be the perfect trader and would always know where the market will go in the future, your total return over a given period will depend on your trading frequency. If you hold your position for a week and thus win all weekly moves of the market, this will be a quite different result than when you hold your position for just one day and make use of all daily movements.

The chart shows you the returns of a perfect trader (100%wins) depending on the holding period of the position. This chart basically is the same as the one you would get when measuring the British coastline with rulers of different length. Just replace the holding period by the length of the ruler and the net profit by the measured length for the total coastline.

## The fractal dimension of markets

As shown above for SPX data, Mandelbrot observed the same for coastlines.

When plotting the measured coastline vs the length of the ruler used, and using a double logarithmic scaling, the measurements are all on a straight line. The gradient +1 of the line defines the fractal dimension of the line. The more wrinkles a line has, the steeper it falls. A flat line would not fall all all, and thus have the dimension of 1. The higher the gradient, the higher the fractal dimension.

I did me a short code to do the same calculations for market data.

The indicator calculates the fractal dimension of a curve, and when applying it on SPX data, it shows a fractal dimension of 1.52.

By itself the number does not have a big meaning in trading, only when it is compared to the fractal dimension of a random walk curve, the fractal properties of the market become visible.

As you can see, a random walk curve is more crinkly than the market, resulting in a higher fractal dimension. The market shows more trends than a random walk, and these times of “nearly straight” trend moves bring down the fractal dimension. Thus you can conclude that a low fractal dimension is a good thing when you are trading trend following strategies.

### More to learn on fractal dimension and market behaviour

The difference between randomness and fractal order can be described using the Hurst exponent. It will tell you if you should bet on trend following or mean reverting strategies. Read more about Hurst and how to calculate it in this previous article on the topic.

I will also do a free webinar on Hurst and fractals next week. Join and ask your questions.