FAMA

Modified on 2011/12/31 14:28 by Eugene — Categorized as: Standard Indicators

Syntax

public static FAMA Series(DataSeries source, double fastLimit, double slowLimit)

Parameter Description

source DataSeries
fastLimit The maximum alpha value
slowLimit The minimum alpha value

Description

FAMA stands for Following Adaptive Moving Average. It was developed by John Ehlers of Mesa Software, and presented in the September 2001 issue of Stocks & Commodities magazine. FAMA is a complimentary indicator to MAMA.

The FAMA indicator uses an alpha (α) value that is half of its corresponding MAMA indicator. This results in an indicator that is synchronized to MAMA, but with vertical movement that is not as great. Consequently, MAMA and FAMA do not cross unless there has been a major change in market direction.

In addition to Price Series, FAMA accepts two additional parameters, FastLimit and SlowLimit. These control the maximum and minimum alpha (α) value that should be applied to the most recent bar of data when calculating FAMA.

You can learn more about the Mesa Adaptive Moving Average at the www.mesasoftware.comweb site.

Interpretation

FAMA is used in conjunction with its complimentary MAMA indicator. Long signals occur when MAMA crosses above FAMA, and short signals when MAMA crosses below FAMA.

Calculation

FAMA = 0.5 * α * MAMA + ( 1 - 0.5 * α) * FAMAPrevious

Example

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { protected override void Execute() { MAMA mama = MAMA.Series( Close, 0.5, 0.05 ); FAMA fama = FAMA.Series( Close, 0.5, 0.05 ); PlotSeries( PricePane, mama, Color.Red, LineStyle.Solid, 1 ); PlotSeries( PricePane, fama, Color.Blue, LineStyle.Solid, 1 ); for(int bar = 40; bar < Bars.Count; bar++) { if( CrossOver( bar, mama, fama ) ) BuyAtMarket( bar+1 ); else if( CrossOver( bar, fama, mama ) ) SellAtMarket( bar+1, LastPosition ); } } } }