Adaptive Moving Average System by Perry KaufmanThe adaptive moving average that was discussed in the interview with Perry Kaufman in the 1998 STOCKS & COMMODITIES Bonus Issue (the article originally appeared in March 1995) is an excellent alternative to standard moving average calculations. In this month's Traders' Tips, I will present two Easy Language studies and an Easy Language system that are based on the adaptive moving average. The adaptive moving average calculation that is used in the studies and system in TradeStation or SuperCharts is performed primarily by a function referred to as "AMA." Another function referred to as "AMAF" is used to calculate the adaptive moving average filter. As always, the functions should be created prior to the development of the studies/system. Type: Function, Name: AMA Inputs: Period(Numeric); Vars: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(.6667), Slowest(.0645), AdaptMA(0); Diff = AbsValue(Close - Close[1]); IF CurrentBar <= Period Then AdaptMA = Close; IF CurrentBar > Period Then Begin Signal = AbsValue(Close - Close[Period]); Noise = Summation(Diff, Period); efRatio = Signal / Noise; Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2); AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]); End; AMA = AdaptMA; Type: Function, Name: AMAF Inputs: Period(Numeric), Pcnt(Numeric); Vars: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(.6667), Slowest(.0645), AdaptMA(0), AMAFltr(0); Diff = AbsValue(Close - Close[1]); IF CurrentBar <= Period Then AdaptMA = Close; IF CurrentBar > Period Then Begin Signal = AbsValue(Close - Close[Period]); Noise = Summation(Diff, Period); efRatio = Signal / Noise; Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2); AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]); AMAFltr = StdDev(AdaptMA-AdaptMA[1], Period) * Pcnt; End; AMAF = AMAFltr; Once you have successfully created both functions, you can then create the two studies and the system. The first indicator displays the adaptive moving average line, with an optional twist. The twist is that the AMA line can be smoothed using linear regression. Thus, I have included in the indicator an input named "smooth" that allows you to determine if the AMA line should be smoothed or not. A "Y" as the input value smoothes the calculation. An "N" simply plots the raw AMA line. This indicator should be scaled to "Same as price data." Type: Indicator, Name: Adaptive Moving Average Inputs: Period(10), Smooth("Y"); IF UpperStr(Smooth) = "Y" Then Plot1(LinearRegValue(AMA(Period), Period, 0), "Smooth AMA") Else Plot2(AMA(Period), "Adaptive MA"); ![]() The second indicator, "Mov Avg Adaptive Fltr," takes the filtering concept and applies it to an indicator. Based on the filtered adaptive moving average (AMAF) parameters, this indicator will plot a vertical blue or red line, depending on the condition that is met. The values reflected by the vertical lines reflect the value of the AMA filter calculation. Some suggested format settings are given after the indicator code. Type: Indicator, Name: Adaptive Moving Average Fltr Inputs: Period(10), Pcnt(.15); Vars: AMAVal(0), AMAFVal(0), AMALs(0), AMAHs(0); AMAVal = AMA(Period); AMAFVAl = AMAF(Period, Pcnt); IF CurrentBar = 1 Then Begin AMALs = AMAVal; AMAHs = AMAVal; End Else Begin IF AMAVal < AMAVal[1] Then AMALs = AMAVal; IF AMAVal > AMAVal[1] Then AMAHs = AMAVal; IF AMAVal - AMALs > AMAFVal Then Begin Plot1(AMAFVal, "Buy"); IF Plot1[1] = 0 Then Alert = True; End Else IF AMAHs - AMAVal > AMAFVal Then Begin Plot2(AMAFVal, "Sell"); IF Plot2[1] = 0 Then Alert = True; End; Plot3(AMAFVal, "AMAFilter"); End; ![]() Style: Plot Name Type Color Weight Plot1 Buy Histogram Blue Thinnest Plot2 Sell Histogram Red Thinnest Plot3 AMAFilter Line Magenta Thinnest Scaling: Screen This code is also available at Omega Research's Web site. The name of the file is "AMA.ELA." Please note that all Traders' Tips analysis techniques posted at Omega Research's Web site can be utilized by both TradeStation and SuperCharts. Whenever possible, the posted analysis techniques will include both Quick Editor and Power Editor formats.
Пока комментариев нет
|
Авторизация
ОпросыАнонсы Вы никогда не сделаете больших денег, пока не научитесь удерживать свои выигрышные позиции, причем чем дольше вы их держите, тем большим потенциалом получения прибыли обладаете.
Читать далее Разделы Трейдинг. Общие темы
Сколько денег нужно для того, чтобы начать торговать на F... Дериватив Опцион Технический анализ. Введение Психология Трейдинга
Основные причины неудач в торговле Управление эмоциями Диалог с собой Демо торговля опасна! Трейдинг. Системы, стратегии
Трендовые индикаторы и компоненты цен Система Kiss Операция Short Sell – торговля воздухом? Когда торговать на Форекс Управление капиталом
Кубик-рубик из опционов Самозащита на рынках Сохранение капитала-критическая точка Сила правильного управления капиталом Куда вложить деньги
Портфели для одиночек HYIP: мошенничество по-американски Инвестиции в камни: плюсы и минусы Финансовый менеджер и инвестиционный гуру Известные личности Брокеры Литература по Трейдингу
Биржевая игра. Сделай миллионы - играя числами Фундаментальный анализ финансовых рынков. Японские свечи. Графический анализ финансовых рынков Как играть и выигрывать на бирже Индикаторы Рынка
Unit Labour Cost Стоимость единицы выпущенной продукции Unemployment Rate Уровень безработицы Retail Sales Розничные продажи Redbook Еженедельный обзор розничных продаж Форекс руководство
Математические средства технического анализа(техническ... Окна Фигуры продолжения тренда Фигуры разворота тренда Новости, Котировки TradeStation Formulas
Neely31 by Gleen Nelly Moving Beyond the Closing Price by Thomas Stridsman Moving Avg. with Res. and Support System by Dennis Tilley Moving Averages with Resistance and Support by Dennis Tilley Metastock formulas
52 Week Hi-Lo Exploration 5 Day High 5 day EMA of 20 day EMA of 1 day momentum 25x25 Bond System Основные определения Технические индикаторы |
||||
Страница создана за 0.096 секунды



Вы никогда не сделаете больших денег, пока не научитесь удерживать свои выигрышные позиции, причем чем дольше вы их держите, тем большим потенциалом получения прибыли обладаете.