MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Kaufman's Adaptive Moving Average I
In MetaStock 6.5 you can easily create the Perry Kaufman Adaptive Moving Average system.
With MetaStock 6.5 running, choose Indicator Builder from the Tools menu andthen click on the New button. Enter the following formulas.

Kaufman's Adaptive Moving Average I

Periods := Input("Time Periods",1,1000, 10);
Direction := CLOSE - Ref(CLOSE,-periods);
Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);
ER := Abs(Direction/Volatility);
FastSC := 2/(2 + 1);
SlowSC := 2/(30 + 1);
SSC := ER * (FastSC - SlowSC) + SlowSC;
Constant := Pwr(SSC,2);
AMA := If(Cum(1) = periods +1, ref(Close,-1)+ constant * (CLOSE- ref(Close,-1)),Prev + constant * (CLOSE - PREV));
AMA

 


Kaufman's Adaptive Moving Average Binary Wave

Periods := Input("Time Periods",1,1000, 10);
Direction := CLOSE - Ref(Close,-periods);
Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);
ER := Abs(Direction/Volatility);
FastSC := 2/(2 + 1);
SlowSC := 2/(30 + 1);
SSC := ER * (FastSC - SlowSC) + SlowSC;
Constant := Pwr(SSC,2);
AMA := If(Cum(1) = periods +1, ref(Close,-1)+ constant * (CLOSE- ref(Close,-1)),Prev + constant * (CLOSE - PREV));
FilterPercent := Input("Filter Percentage",0,100,15)/100;
Filter := FilterPercent * Std(AMA - Ref(AMA,-1),Periods);
AMALow := If(AMA < Ref(AMA,-1),AMA,PREV);
AMAHigh := If(AMA > Ref(AMA,-1),AMA,PREV);
If(AMA - AMALow > Filter, 1 {Buy Signal},If(AMAHigh - AMA > Filter, -1 {Sell Signal}, 0 {No_Signal}))

 

If you want to see the Adaptive Moving Average, just plot it on anychart.
If you want to see the buy and sell signals of the Adaptive Moving Average system plot the Adaptive Moving Average Binary wave.
This binary wave plots a 1 when there is a buy signal, a �1 when thereisa sell signal and a zero when there is no signal.
Source / From: TOP
http://www.equis.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!