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 #

Exponential Moving Average - Close - Weekly by Jose Silva

Plots true weekly EMA/SMA & trigger signals on daily charts. Independent of any missing data.

This formula need "Calendar Week Counter" indicator.


Exponential Moving Average - Close - Weekly

{ True weekly Close Exponential Mov Avg v4.0 }
{ Plot on Daily or Weekly charts }
{ References indicator "Calendar Week counter" }
{ Plot is independent of any missing chart data }
{ (c) Copyright 2003-2004 Jose Silva }
{ http://www.metastocktools.com }

pds:=Input("Weekly EMA periods",1,520,4);
shift:=1+Input("EMA vertical shift %",
-100,100,0)/100;
plot:=Input("plot: [1] EMA, [2] Crossover signals",1,2,1);

y:=Fml("Calendar Week counter");
Wkchart:=LastValue(Cum(y=ValueWhen(2,1,y)))=0;
NuWk:=y>ValueWhen(2,1,y);
pds:=If(pds>Cum(NuWk),Cum(NuWk),pds);
WkCl:=ValueWhen(1,NuWk,ValueWhen(2-Wkchart,1,C));
WkEma:=ValueWhen(1,NuWk,PREV)
*(1-2/(pds+1))+WkCl*2/(pds+1);
WkEma:=WkEma*shift;
signals:=Cross(C,WkEma)-Cross(WkEma,C);

If(plot=2,signals,WkEma)

 

Source / From: TOP
http://www.metastocktools.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!