[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bad Args



PureBytes Links

Trading Reference Links

Dear Tomasz and Other AFL Gurus,

This is an indicator to calculate zigzag from highs and lows. I 
translated the indicator from MS and it no longer works. What 
happened? It keeps giving me "bad args" error.

I use "lastvalue" to replace "PREV".

===========================
A=IIf(LastValue(A)==1,IIf(L<HighestSince(1,LastValue(A)!=1,H)*0.96,-
1,LastValue(A)),IIf(LastValue(A)==-1,IIf(H>LowestSince(1,LastValue(A)!
=-1,L)*1.04,+1,LastValue(A)),IIf(LastValue(A)=0,IIf(H>LowestSince
(1,LastValue(A)!=-1,L)*1.04,+1,IIf(L<HighestSince(1,LastValue(A)!=1,H)
*0.96,-1,LastValue(A))),LastValue(A))));
HL=IIf(A==1, LowestSince(1,A!=-1,L), If(A=-1, HighestSince(1,A!=1,H), 
LastValue(A)));
Graph1=HL;