Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
ZZ, Using the free forum.dll to eliminate the N/A from the ValueWhen() function calls: Code:
data:=ATR(21)/MP()*100;
i:=RSI(14);
hi1:=Highest(ExtFml("forum.sum",ValueWhen(1,data<=1,i),1));
hi2:=Highest(ExtFml("forum.sum",ValueWhen(1,data>1 AND data<=2,i),1));
hi3:=Highest(ExtFml("forum.sum",ValueWhen(1,data>2 AND data<=4,i),1));
hi4:=Highest(ExtFml("forum.sum",ValueWhen(1,data>4,i),1));
lo1:=Lowest(ExtFml("forum.sum",ValueWhen(1,data<=1,i),1));
lo2:=Lowest(ExtFml("forum.sum",ValueWhen(1,data>1 AND data<=2,i),1));
lo3:=Lowest(ExtFml("forum.sum",ValueWhen(1,data>2 AND data<=4,i),1));
lo4:=Lowest(ExtFml("forum.sum",ValueWhen(1,data>4,i),1));
hilo1:=hi1-lo1;
hilo2:=hi2-lo2;
hilo3:=hi3-lo3;
hilo4:=hi4-lo4;
zero:=Power(10,-8);
100*
If(data<=1,(i-lo1)/Max(hilo1,zero),
If(data>1 AND data<=2,(i-lo2)/Max(hilo2,zero),
If(data>2 AND data<=4,(i-lo3)/Max(hilo3,zero),
(i-lo4)/Max(hilo4,zero))));
Hope this helps. wabbit [:D]
|