+1 888 340 6572 
Home/ Support/ Knowledgebase

Knowledgebase

The Knowledgebase and Wiki are a collection of helpful resources for MultiCharts Trading Platform customers.

You can search the base by section, by keyword(s) or both. Select a section from the pulldown menu at the left and enter a keyword or keywords separated by spaces and click "Search". You can also select a section and view every article in it. To do this leave the keyword field blank. The results of your search will be displayed in this frame.
Search in     for   




Averages > Kaufman Moving Average Adaptive (KAMA) [eSignal EFS Indicators]


Download: kama.efs

Category: Indicator > Averages

Description:

Everyone wants a short-term, fast trading trend that works without large losses. That combination does not exist. But it is possible to have fast trading trends in which one must get in or out of the market quickly, but these have the distinct disadvantage of being whipsawed by market noise when the market is volatile in a sideways trending market. During these periods, the trader is jumping in and out of positions with no profit-making trend in sight. In an attempt to overcome the problem of noise and still be able to get closer to the actual change of the trend, Kaufman developed an indicator that adapts to market movement. This indicator, an adaptive moving average (AMA), moves very slowly when markets are moving sideways but moves swiftly when the markets also move swiftly, change directions or break out of a trading range.

Usage:

AMA is using the efficiency ratio to adjust the speed of the moving average. In order to construct the AMA, many different qualities of the market must be known. First is the price direction, or the net price change over n days. This is the difference between the price today and the price n days ago. Kaufman uses n of 10 days in Smarter Trading: Direction = Price – price (n).




Inputs:

Length - number of bars to use in calculation

EFS Code:
/*******************************************************************

Description : This Indicator plots KAMA Indicator
Provided By : Developed by TS Support, LLC for eSignal. (c) Copyright 2002
********************************************************************/

function preMain()
{
setStudyTitle("KAMA");
setCursorLabelName("KAMA", 0);
setDefaultBarFgColor(Color.red, 0);
setPriceStudy(true);
}

vnoise = new Array();
var AMA_1 = 0;

function main(period) {
if (period == null)
period = 21;
var i;
var efratio = 1;
var AMA = 0;
var fastend = .666;
var slowend = .0645;
var noise = 0;
var signal = 0;
var smooth = 0;
var diff = 0;

diff = Math.abs(close() - close(-1));
if (getBarState() == BARSTATE_NEWBAR){
for(i = period - 1; i > 0; i--)
vnoise[i] = vnoise[i - 1];
vnoise[0] = diff;
}
if(getCurrentBarIndex() - getOldestBarIndex() > period){
signal = Math.abs(close() - close(-period));
for(i = 0; i < period; i++)
noise += vnoise[i];
if(noise != 0)
efratio = signal / noise;
}
if(getCurrentBarIndex() - getOldestBarIndex() <= period)
AMA = close();
smooth = Math.pow(efratio * (fastend - slowend) + slowend,2);
AMA = AMA_1 + smooth * (close() - AMA_1);
if (getBarState() == BARSTATE_NEWBAR)
AMA_1 = AMA;
return AMA;
}

Contact Support
Discussion Forum
Project Management
Online Help & Wiki
Video Tutorials
Blog