NAME

GT::Indicators::FRAMA - FRactal Adaprive Moving Average


DESCRIPTION

An exponential moving average gives more importance to recent prices ... similarly a Frama uses a variable (adaptive) alpha

Parameters

Period (default 20)

The first argument is the period used to calculed the average.

Other data input

The second argument is optional. It can be used to specify an other stream of input data for the average instead of the close prices. This is usually an indicator (detailed via {I:MyIndic <param>}).

Calculation The alpha is calculated following http://www.mesasoftware.com/technicalpapers.htm see the self explaining code below :D when knowing the alpha FRAMA is FRAMA[n] = FRAMA[n-1] + alpha * ( INPUT - FRAMA[n-1] )

In TA, the first value is often constructed as SMA(N).

Note: One criticism could be that the EMA is calculated starting from the designated period. But actually the EMA goes all the way back to the beginning of the available data. But in all tools I checked they start computation from the loaded data on.

Creation

 GT::Indicators::FRAMA->new()
 GT::Indicators::FRAMA->new([20])

If you need a 30 days FRAMA of the opening prices you can write one of those lines :

 GT::Indicators::FRAMA->new([30, "{I:Prices OPEN}"])

A 10 days EMA of the RSI could be created with :

 GT::Indicators::FRAMA->new([10, "{I:RSI}"])
 note!!! The number of days has to be EVEN!!