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 #

TEMA - Multiple-type by Jose Silva
Multiple-type Triple Moving Average (TEMA), fully adjustable.

TEMA - Multiple-type

{ Multiple-type TEMA v1.0 }
{ (c) Copyright 2004 Jose Silva }
{ For personal use only }
{ http://www.metastocktools.com }

{ User inputs }
pds:=Input("TEMA periods",1,2520,21);
type:=Input("[1]EMA [2]SMA [3]TmSr [4]Tri [5]Var [6]Vol [7]Wght",1,7,1);
x:=Input("use: [1]Open, [2]High, [3]Low, [4]Close, [5]WClose",1,5,4);
shift:=Input("TEMA vertical shift %",-100,100,0)/100+1;

{ Price field selection }
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),C))));

{ 1 - Exponential TEMA }
Tma1:=(3*Mov(x,pds,E)-(3*Mov(Mov(x,pds,E),pds,E))+
(Mov(Mov(Mov(x,pds,E),pds,E),pds,E)));

{ 2 - Simple TEMA }
Tma2:=(3*Mov(x,pds,S)-(3*Mov(Mov(x,pds,S),pds,S))+
(Mov(Mov(Mov(x,pds,S),pds,S),pds,S)));

{ 3 - Time Series TEMA }
Tma3:=(3*Mov(x,pds,T)-(3*Mov(Mov(x,pds,T),pds,T))+
(Mov(Mov(Mov(x,pds,T),pds,T),pds,T)));

{ 4 - Triangular TEMA }
Tma4:=
(3*Mov(x,pds,TRI)-(3*Mov(Mov(x,pds,TRI),pds,TRI))+
(Mov(Mov(Mov(x,pds,TRI),pds,TRI),pds,TRI)));

{ 5 - Variable TEMA }
Tma5:=
(3*Mov(x,pds,VAR)-(3*Mov(Mov(x,pds,VAR),pds,VAR))+
(Mov(Mov(Mov(x,pds,VAR),pds,VAR),pds,VAR)));

{ 6 - Volume adjusted TEMA }
Tma6:=
(3*Mov(x,pds,VOL)-(3*Mov(Mov(x,pds,VOL),pds,VOL))+
(Mov(Mov(Mov(x,pds,VOL),pds,VOL),pds,VOL)));

{ 7 - Weighted TEMA }
Tma7:=(3*Mov(x,pds,W)-(3*Mov(Mov(x,pds,W),pds,W))+
(Mov(Mov(Mov(x,pds,W),pds,W),pds,W)));

{ Select construction type }
TMA:=
If(type=1,Tma1,
If(type=2,Tma2,
If(type=3,Tma3,
If(type=4,Tma4,
If(type=5,Tma5,
If(type=6,Tma6,
Tma7))))));

{ Plot on price chart }
TMA*shift

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.