Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
{Volatility-adjusted, dynamic-period EMA v2.0}
{©Copyright 2003 Jose Silva}
{josesilva22@yahoo.com}
pds:=Input("EMA periods",1,2520,21);
x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5",1,5,4);
plot:=Input("plot: EMA=1 volatility=2 dynamic EMA periods=3",1,3,1);
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,C))));
Vt:=Stdev(C,5)/Mov(Stdev(C,5),10,S);
pds:=pds*.75/(Vt+.1);
pds:=If(Cum(1)-13<pds,Cum(1)-13,pds);
pds:=If(pds<1,1,pds);
DyEma:=x*2/(pds+1)+PREV*(1-2/(pds+1));
If(plot=2,Vt*10,If(plot=3,pds,DyEma))
|