Vic, Make sure you're setting all variable calls as
S1:= If .......... (and end each with a semicolon per convention) ";" S2:= If .......... ; etc.
As for 6.0 compatibility, I believe it supported the PREVIOUS function as does 6.5. If not, or should you care to try a speed-tweaked version posted by Tim Kruzel on the Metastock list earlier this month try this out:
============================== Date: Sun, 12 Apr 1998 00:37:00 -0500 From: TKruzel <TKruzel@centuryinter.net> To: Metastock-Users-List <metastock-list@metastock.com>
For those of you trying to use Mr. Widner's formulas, I Think you will find the following to be equivalent and they avoid the use of PREVIOUS (a computational pig).
In the MetaStock Indicator Builder create an indicator called:
Enter_Long_SR (or whatever you want to call it)
Copy the following into the indicator:
{*********************************************}
S1:=ValueWhen(1,Ref(LOW,-4)=LLV(LOW,9),Ref(LOW,-4)); S2:=ValueWhen(1,S1<>Ref(S1,-1),Ref(S1,-1));
S3:=ValueWhen(1,S1<>Ref(S1,-1),Ref(S2,-1));
S4:=ValueWhen(1,S1<>Ref(S1,-1),Ref(S3,-1));
S5:=ValueWhen(1,S1<>Ref(S1,-1),Ref(S4,-1));
S6:=ValueWhen(1,S1<>Ref(S1,-1),Ref(S5,-1));
WSO:=100*(1-(Int(S1/CLOSE)+Int(S2/CLOSE)+ Int(S3/CLOSE)+Int(S4/CLOSE)+ Int(S5/CLOSE)+Int(S6/CLOSE))/6);
{*********************************************}
R1:=ValueWhen(1,Ref(HIGH,-4)=HHV(HIGH,9), Ref(HIGH,-4)); R2:=ValueWhen(1,R1<>Ref(R1,-1),Ref(R1,-1));
R3:=ValueWhen(1,R1<>Ref(R1,-1),Ref(R2,-1));
R4:=ValueWhen(1,R1<>Ref(R1,-1),Ref(R3,-1));
R5:=ValueWhen(1,R1<>Ref(R1,-1),Ref(R4,-1));
R6:=ValueWhen(1,R1<>Ref(R1,-1),Ref(R5,-1));
WRO:=100*(1-(Int(R1/CLOSE)+Int(R2/CLOSE)+ Int(R3/CLOSE)+Int(R4/CLOSE)+ Int(R5/CLOSE)+Int(R6/CLOSE))/6);
{*********************************************}
EnterLong:=If(((WSO > Mov(WSO,4,S)) OR (Mov(WRO,30,S) > 95)),1,0);
{*********************************************}
Then go to the MetaStock System Tester and create a test called:
SR_Long (or whatever you want to call it)
The enter long criteria is simply:
Fml("Enter_Long_SR")
Set your STOPS as indicated and you should have it.
Regards, Tim ==============================
I haven't set it up yet, but it looks to be properly coded.
Good luck, Craig |