Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....

#1 Selling Amibroker Plugin featuring:

Neural Networks
And Much More ....
Find Out More Here

FRAMA - Fractal Adaptive Moving Average for Amibroker (AFL) walid over 11 years ago Amibroker (AFL)

Rating:
Tags:
amibroker, moving average

Another form of moving Average that used the fractal theory and ploted by Adaptive Moving Average (AMA)

Similar Indicators / Formulas

Hull Moving Average (HMA)
Submitted by kaiji about 12 years ago
Beauty
Submitted by sbtc555 over 8 years ago
Smoothed MA (SSMA)
Submitted by kelvinhand over 8 years ago
Trend Scalping System
Submitted by esnataraj almost 12 years ago
Buff Volume Weighted Moving Averages
Submitted by kaiji about 12 years ago
Volume wieghted moving average
Submitted by kaiji about 12 years ago

Indicator / Formula

_SECTION_BEGIN("FRAMA");
// FRAMA - Fractal Adaptive Moving Average
Price = (H+L)/2;
N = Param( "N", 16, 2, 40, 2 ); // must be even **
N3 = ( HHV( High, N ) - LLV( Low, N ) ) / N;

HH = HHV( High, N / 2 ) ;
LL = LLV( Low, N / 2 );

N1 = ( HH - LL ) / ( N / 2 );

HH = HHV( Ref( High, - N/2 ), N/2 );
LL = LLV( Ref( Low, - N/2 ), N/ 2 );

N2 = ( HH - LL ) / ( N / 2 );

Dimen = IIf( N1 > 0 AND N2 > 0 AND N3 > 0, ( log( N1+N2) - log( N3 ) )/log( 2 ), Null );

alpha = exp( -4.6 * (Dimen -1 ) );
alpha = Min( Max( alpha, 0.01 ), 1 ); // bound to 0.01...1 range

Frama = AMA( Price, alpha );

Plot( Frama, "FRAMA("+N+")", colorRed, styleThick );
Plot( EMA( C, N ) , "EMA("+N+")", colorBlue );
Plot( C, "Close", colorBlack, styleCandle );

//-----------------------------------------------------------------------
//**Odd period inputs can be allowed with the inclusion of fol code :-

//if( (N % 2) != 0 ) //or if ( (N & 1) != 0 )N ++
_SECTION_END();