## Wednesday, July 16, 2008

### What to expect: Trend and Volatility

I assume here that the price evolution is modelised by a Fractional Brownian Motion (FBM) of index-$\alpha$ (0<$\alpha$<1): href="http://www.codecogs.com/">$X:[0,\infty)\rightarrow&space;\mathbb{R}$

where X(t) represents the price at time t, so that we have the following equality (E1) about the expectation of dependent price increments (demonstration in [FALC03]pp267-268):

$E[(X(t)-X(0))(X(t+h)-X(t))]=\frac{1}{2}[(t+h)^{2\alpha&space;}-t^{2\alpha&space;}-h^{2\alpha&space;}]$

Clearly the value $\alpha$=1/2 seems to play a very specific role in that equation, since it cancels out its right-side term.
$\alpha$=1/2 indeed consists in the classical Brownian Motion (Wiener Brownian Motion:WBM) where the increments over time of the variable X are independent.
This index $\alpha$ is directly linked to the Fractal Dimension Df by the relation:
$\alpha=2-D_{f}$

Therefore, when $\alpha$=1/2, which is happening when Df=1.5, we have a genuine Random Walk.
When such is not the case, however, we can say:

1) Df<1.5
This case is equivalent to $\alpha$>1/2, and we can then expect from the equality (E1) that X(t+h)-X(t) tend to be of the same sign as X(t)-X(0), therefore, if X(t) has an history of increasing, the next move X(t+h) will be more likely to be up, similarly if X(t) has an history of decreasing, the next move will tend to be down. In this case, we are in a trend.

2) Df>1.5
This case is equivalent to $\alpha$<1/2.> In this case, X(t+h)-X(t) tend to be of the opposite sign of X(t)-X(0), therefore, following the same logic as above, we are in a trend reversal period.

## Wednesday, July 9, 2008

### Intermezzo

Here is one of the other things (from the title), I may, every now and then, discuss.
I am currently reading "The rest is noise" by Alex Ross, he also has a Blog here: http://www.therestisnoise.com/
The book is a journey through the music of the 20th century. I am just starting it, but my first impression is that it's a pleasant read, well-written, that takes the reader through the mind, life and works of some great composers. The first chapter covers R. Strauss and Mahler, and their intriguing relationship, that no doubt plays a prominent role in their attitude to their art, and that Ross subtly uses to inform their respective compositions.

A little digression here.
It seems the musical 20th century started with a beautiful woman (Salome) kissing the lips of a beheaded John the Baptist (Jochanaan) in a frighfully orchestrated bliss (in the final scene of Salome, by R. Strauss, inspired by the play of Oscar Wilde). The tune was set for the 20th century to unfold: The old religious lores were to be taken out of their somniferous yoke of dogmatism, and lay bare the darkest secrets of the soul.

## Tuesday, July 8, 2008

### Comments on some existing fractal-related tools

A few indicators, that relate to fractals (or seem to do so) are already easily available on several platform.

The first, maybe the simplest is called "Fractals", and when you use it, it draws little arrows, some pointing up, others pointing down, like this:

This indicator, however, has nothing to do with fractals, it relates to Elliot Wave Theory, as explained here: http://trading-stocks.netfirms.com/fractals.htm

A derivation of this is called the "fractal channel" which links the little arrows, similarly, it has nothing to do with fractals.

More relevant then is the Fractal Adaptive Moving Average, which relates to Kaufman's AMA, but uses fractal theory to determine the current volatility of the market in order to adjust the speed of the MA. The idea of the AMA is to slow down the MA when the market is moving sideways, and to speed it up when there is a trend. To achieve this objective, John Ehlers developped the FRAMA, using the Fractal Dimension as a direct measurement of Volatility, he explains his method in a file (title: FRAMA) that can be downloaded from this address: http://www.mesasoftware.com/technicalpapers.htm

On the following graph, I plotted a simple 16-MA (blue), an exponential 16-MA (yellow) and the FRAMA in red (with a reference period of 16 as well). Below are the fractal dimension used by the FRAMA (and computed from the formula of the above paper), as well as a more sophisticated fractal dimension (to which I will come later):
Clearly, during the sideways market (until about 16:45), the FRAMA is somewhat smoothier than the two others, and when the trend goes on, it also reacts faster. Therefore, we can say that the FRAMA is a good AMA. However, it could be better, the computation of the fractal dimension is rough to say the least, it oscillates between extreme values (from 2 to below 1) that don't even make sense mathematically. The FDI plotted in the lowest window, displays a more reasonable fractal dimension (the period to calculate both is 16), for those interested in this tool, I would therefore advise to use the FDI and that might entail a modification in the factor -4.6 in the computation of the coefficient alpha (from the FRAMA paper) where Ehlers recommends:

$\alpha=\exp(-4.6(D-1))$

The fractal dimension Df in the FDI follows the following formula:

$D_{f}=1+\frac{Log[2\sum_{i=1}^{N}\sqrt{(\frac{close(i)-close(i-1)}{pricerange})^{2}+\frac{1}{N^{2}}}]}{Log(2N-2)}$

Where N is the number of periods(price valuations) considered. Df provides us with some idea of volatility, when Df gets close to 2, it means that we have very high volatility, the closer to 1 and we have low volatility or, in other terms, a well-defined trend. But that's very general qualitative comments, the passage to a computable quantity is trickier. Elhers assumes that price movements are following a lognormal distribution (which is not the case) and, on this basis, comes to compute the value of alpha as an exponential. I will, in the near future, share my reflections on how to get an identified numerical measure of entropy (volatility) from Df.

But for now, my point is merely to say that the fractal dimension is an indicator of volatility, it does not inform on the direction of the market. To get this direction, many analysts rely on MA or combination of them (such as Ichimoku, Bands,...), those indicators may be refined, using the fractal theory, but they then become hybrid indicators, mixing two diverging conceptions of what price movement is about.

As of now, and as far as I know, the only technical tool fractal theory is providing is a measure of volatility, but volatility in itself may be an interesting information to set up one's stop and position size. It may not be necessary to use volatility as a mere entry variable into another indicator.