[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Metastockusers] mov



PureBytes Links

Trading Reference Links



> How to do for visualizing a weekly EMA (C,5) in a daily chart?
> thanks

The following code is accurate but does not give a value for the current
partially completed week. I have an adjustment that does that but it's
pointless because the value changes as each day of the week is added. Only
values for completed weeks are fixed and correct.

This formula can also be used to find the weekly Wilders Smoothing  value by
changing Pct to "Pct:=1/Pds;"

Roy

  {Weekly Frame EMA}
Pds:=Input("Weekly periods",1,99,5);
Pct:=2/(Pds+1);
W1:=DayOfWeek()=5; W2:=Alert(W1,2);
W3:=DayOfWeek()<=Ref(DayOfWeek(),-1);
We:=If(W1,1,If(W2=0 AND W3,2,0));
Wcl:=ValueWhen(1,We>0,If(We=1,C,Ref(C,-1)));
Ema:=If(We>0,If(Cum(We>0)=1,C,PREV)*(1-Pct)+ Wcl*Pct,PREV);
Ema;



To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/