Here's my version of a weekly MACD for daily charts. Any exploration using this formula requires around 600 daily bars to produce an accurate result from the 26 week EMA module (variable X). With 3 PREV-based variables in the formula this makes for a rather slow exploration. The 26 week EMA formula has only 1 PREV-based variable so it runs a little faster but also requires around 600 daily bars. Note that both MACD and EMA formulas use the Forum DLL.
Roy
MetaStock Tips & Tools
{Weekly MACD}
{This indicator uses the Equis Forum DLL}
{Roy Larsen, 2004-2007}
{User settings}
N:=Input("Weekly MACD Signal Periods",1,19,9);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,0);
{0, update on last bar of current frame}
{1, update on each new bar}
{2, update on first bar of new frame}
{Weekly frame timing}
{* Day counter from metastock@wabbit.com.au}
M:=Month();A:=Int((14-M)/12);D:=DayOfMonth();
Y:=Year()+4800-A;B:=M+(12*A)-3;
M:=D+Int((2+153*B)/5)+(365*Y)+Int(Y/4)-Int(Y/100)+Int(Y/400)-32045;
{*}I:=Int(M/7);
I:=I-ValueWhen(2,1,I);
G:=LastValue(Lowest(Sum(I>0,5))=5);
M:=G+I;F:=G+(M=0)*ExtFml("Forum.Sum",Ref(I,1),1);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=Alert(A,2)*(A=0);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
{Weekly CLOSE}
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
{Calculate and plot weekly MACD and signal line}
X:=0.15; Y:=0.075; N:=2/(N+1); J:=J>0;
X:=If(Cum(J)=1,K,PREV*If(J,1-X,1)+J*K*X);
Y:=If(Cum(J)=1,K,PREV*If(J,1-Y,1)+J*K*Y);
R:=X-Y;
Z:=If(Cum(J)=1,R,PREV*If(J,1-N,1)+J*R*N);
Z; {Weekly MACD signal line}
R; {Weekly MACD}
{end}
{Weekly EMA - Close}
{This indicator uses the Equis Forum DLL}
{Roy Larsen, 2004-2007}
{User settings}
N:=Input("Weekly EMA / Close, Periods",1,99,26);
Q:=Input("Mode, 0=Static 1=Dynamic 2=Delayed",0,2,1);
{0, update at last bar of current frame}
{1, update on each new bar}
{2, update on first bar of new frame}
{Weekly frame timing}
{* Day counter from metastock@wabbit.com.au}
M:=Month();A:=Int((14-M)/12);D:=DayOfMonth();
Y:=Year()+4800-A;B:=M+(12*A)-3;
M:=D+Int((2+153*B)/5)+(365*Y)+Int(Y/4)-Int(Y/100)+Int(Y/400)-32045;
{*}I:=Int(M/7);
I:=I-ValueWhen(2,1,I);
G:=LastValue(Lowest(Sum(I>0,5))=5);
M:=G+I;F:=G+(M=0)*ExtFml("Forum.Sum",Ref(I,1),1);
A:=LastValue(Cum(1)-1)=Cum(1);
B:=Alert(A,2)*(A=0);
J:=If(F,1,If(Alert(F,2)=0 AND M,2,0));
J:=If(A+LastValue(J)>2 OR B+(Q=1)=2,1,J);
J:=If(G,1,If(Q=2 OR Cum(J)<=1,M*2,J));
{Weekly CLOSE}
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
{Calculate and plot weekly EMA of CLOSE }
N:=2/(1+N);J:=J>0;
If(Cum(G+J>0)<3-G,K,PREV*If(J,1-N,1)+J*K*N);
{end}