Hi ALM
Change
R1:=ValueWhen(81,J,K); to
R1:=ValueWhen(15,J,K);
From this you can probably see that the first part
of each weekly ROC for "X" periods is calculated by ValueWhen(X+1, J, K). From that observation you should be able to adjust
the ROC "weeks" values to whatever you want.
Have you noticed that plotting the weekly formula
on a weekly chart matches the plot from your original formula plotted on
the same chart? This feature makes it easy to test any changes you make for
accuracy.
Regards
Roy
----- Original Message -----
Sent: Wednesday, June 22, 2005 6:06
PM
Subject: [EquisMetaStock Group] Re:
Plotting Weekly Values of indicator on daily chart - need you help, Roy!
Hi! Roy,
Many thanks for your WMA codes. It worked
flawlessly! One question, though .... what sort of modification do I need
to do on your WMA codes if I were to change the parameter of my indicator
from
osc1:=Mov(ROC(C,80,%)+ROC(C,11,%),10,W)
to
osc1:=Mov(ROC(C,14,%)+ROC(C,11,%),10,W)
So sorry to trouble
you.
Thanks again and best regards, ALM
--- In
equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx>
wrote: > And here's the WMA version. > >
{Weekly ALM Custom ROC} > {2005 Roy Larsen,
www.metastocktips.co.nz} > {for use on daily charts
with > Jose Silva's "Calendar Week counter"} >
F:=Input("End of Week, 5=Friday 6=Saturday
7=Sunday",5,7,5); > Q:=Input("Display Mode, 0=Static
1=Dynamic 2=Test",0,2,1); > {0=Display, update on
Friday (when possible)} > {1=Display, update on each new
bar} > {2=Backtest, update on first bar of new week} >
G:=LastValue(Highest(Sum(DayOfWeek()=F,5))=5); > I:=Fml("Calendar Week
counter"); > I:={Abs}(I-ValueWhen(2-G,1,I)); M:=G OR I>0; >
F:=G OR (DayOfWeek()=F AND I=0); >
A:=LastValue(Cum(1)-1)=Cum(1); > B:=ValueWhen(2,1,A); >
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)); >
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C))); > R1:=ValueWhen(81,J,K);
R1:=(K-R1)/R1; > R2:=ValueWhen(12,J,K); R2:=(K-R2)/R2;
Y:=R1+R2; > (ValueWhen(11,J,Y)+ValueWhen(10,J,Y)*2+ >
ValueWhen(9,J,Y)*3+ValueWhen(8,J,Y)*4+ >
ValueWhen(7,J,Y)*5+ValueWhen(6,J,Y)*6+ >
ValueWhen(5,J,Y)*7+ValueWhen(4,J,Y)*8+ >
ValueWhen(3,J,Y)*9+ValueWhen(2,J,Y)*10+Y*11)/66;
Yahoo! Groups Links
|