How To Trade In Equity ?

Here you will get the Basic Methods of Trading in Equites & Bonds, which are supported by well known Equity Trading Guru.

Have You Joined This Blog ?

Please Join This Blog, Before Leaving , It will Make this Blog Reachable to Others Investors. Please Refer This Blog to Your Friends Also.

Sunday, May 16, 2010

AMIBROKER: FRACTAL DIMENSION INDICATOR

In “Fractal Dimension As A Market Mode Sensor” in this issue, authors John Ehlers and Ric Way present the fractal dimension indicator.
Implementing it is easy in AmiBroker Formula Language. A ready-to-use formula for the article is presented in the Listing 1. To use it, enter the formula in the Afl Editor, then press the “Insert Indicator” button. Then you would need to click on the chart with the right mouse button and choose “Parameters” from the context menu in order to define parameter N.
A sample chart is shown Below-
LISTING 1


Price = (H+L)/2;
N = Param("N", 30, 10, 100, 2 );
Smooth = ( Price +
2 * Ref( Price, -1 ) +
2 * Ref( Price, -2 ) +
Ref( Price, -3 ) ) / 6;
N3 = (HHV( Smooth, N ) - LLV( Smooth, N ))/N;
HH2 = HHV( Smooth, N/2 );
LL2 = LLV( Smooth, N/2 );
N1 = ( HH2 - LL2 )/(N/2);
N2 = Ref( HH2 - LL2, - N/2 )/(N/2);
Ratio = ( log( N1 + N2 ) - log( N3 ) )/log( 2 );
dimen = Null;
for( i = 20+N; i < BarCount; i++ )
{
ratio[ i ] += Nz( dimen[ i - 1 ] );
ratio[ i ] *= 0.5;
for( sr = 0, k = 0; k < 20; k++ )
sr += ratio[ i - k ];
dimen[ i ] = sr / 20;
}
Plot( Dimen, "Fractal dimension", colorRed );
PlotGrid( 1.6, colorBlue );
PlotGrid( 1.4, colorBlue );


—Tomasz Janeczko, AmiBroker.com
http://www.amibroker.com/

Cycle Or Trend? Fractal Dimension As A Market Mode Sensor

We can use the fractal dimension as a natural way to sense whether the market is in a cycle mode or trend mode. Is the market trending or cycling? What intuitively seems like an easy question to answer is perhaps one of the most vexing in all technical analysis. If a trader knows the market mode, then a straightforward approach could be taken to adapt a trading strategy to that mode. We would apply a swing trading technique such as an overbought/oversold oscillator in cycle mode and a trend-following technique such as a moving average crossing in trend mode. In this article, we address the cycle/trend problem using the fractal dimension.

A number of tools have been developed to differentiate between cycle and trend modes. For example, we can compare the trend slope over a full cycle period to the amplitude swing of the cycle and use the ratio. More recently, we developed empirical mode decomposition to separate the market into cycle and trend mode components. In this article, we will consider the fractal dimension as a natural way to determine whether the market is in a cycle mode or trend mode.
Fractal dimension
There is no argument that market prices are fractal. Price charts look similar regardless of time frame. If you remove the labels from a five-minute chart, a daily chart, and a weekly chart, you would have difficulty telling them apart. Fractal shapes are self-similar because they have the same roughness and sparseness regardless of time interval. This self-similarity can be defined by the fractal dimension that describes sparseness at all magnification levels.
To determine the fractal dimension of a generalized pattern, we cover the pattern with a number N of small objects of several various sizes S. The relationship of the number of objects in two sets of sizes is: