PureBytes Links
Trading Reference Links
|
Hi Norman
Try this. I'm not sure that I've treated the Peak() function correctly, bit it appears to just be
operating as an Init or IsDefined() function. I've only tested it on one chart and the 6 hits all
tally . Hope this is of some help. The weekly timing code could be made much simpler using Peak()
with DayofWeek() but the timing could be less accurate in the event of missing data bars.
{Weekly for Norman}
{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,0);
{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));
Lw:=LowestSince(1,M,L);
Lw:=ValueWhen(1,J,If(J=1,Lw,ValueWhen(2-G,1,Lw)));
K:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C)));
Bsetup:=Cum((J>0)*(K<ValueWhen(5,J,K)));
Bsetup:=(Bsetup-ValueWhen(10,J>0,Bsetup))=9 AND
ValueWhen(10,J,K)>=ValueWhen(14,J>0,K);
BCD:=HighestSince(1,Peak(1,Bsetup,.001),
(K<=ValueWhen(3,J,Lw))+ValueWhen(1,J,PREV));
Buy:=BCD-ValueWhen(1,ValueWhen(1,J,Bsetup),BCD)=13;
Buy AND ValueWhen(2,J,Buy)=0;
Kind regards
Roy
www.metastocktips.co.nz
----- Original Message -----
From: "ruagoodp" <almutwinter@xxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: Sunday, May 22, 2005 10:31 PM
Subject: [Metastockusers] Weekly Indicator needed
> Hi Roy,
>
> Could this daily formula be converted into a weekly formula?
> Hope you can help...
>
> Bsetup:=Sum(C<Ref(C,-4),9)=9 AND
> Ref(C,-9) >= Ref(C,-13);
> BCD:=HighestSince(1,Peak(1,Bsetup,.001),(C<=Ref(L,-2)) + PREV);
> BUY:=BCD-ValueWhen(1,Bsetup,BCD)=13 AND
> Ref(BCD-ValueWhen(1,Bsetup,BCD)=13,-1)<>1;
> buy
>
> Norman
>
>
>
>
>
> --------------------------------------------------------------------------------
> Yahoo! Groups Links
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/Metastockusers/
>
> b.. To unsubscribe from this group, send an email to:
> Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/zMEolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Metastockusers/
<*> To unsubscribe from this group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|