Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi Jamaan
In response to your message I looked previous exchanges and decided that the code below is probably what you were having a problem with on tick data.
{ZigZag Volume Histogram}
{Roy Larsen, 30/7/12}
N:=Input("ZigZag % Parameter",0,99,10);
A:=Zig(C,N,%);
B:=Ref(A,-1)>A AND Ref(A,1)>A OR
A>Ref(A,-1) AND A>Ref(A,1);
X:=A>ValueWhen(2,1,A); Z:=Cum(1);
{Calculate/plot frame Volume}
D:=BarsSince(Ref(B,-1)+(Z=1))+1;
ExtFml("Forum.Sum",V,D)*X;
ExtFml("Forum.Sum",V,D)*(X=0);
I've eliminated the Forum DLL and replaced the Variable Sum function and replaced it with the last two lines of the following code. The use of PREV with LastValue() enables the basic Sum() function to recognize a variable Periods Parameter.
{ZigZag Volume Histogram}
{Roy Larsen, 2012-2015, 20/5/15}
N:=Input("ZigZag % Parameter",0,99,10);
A:=Zig(C,N,%);
B:=Ref(A,-1)>A AND Ref(A,1)>A OR
A>Ref(A,-1) AND A>Ref(A,1);
X:=A>ValueWhen(2,1,A); Z:=Cum(1);
{Calculate/plot frame Volume}
D:=BarsSince(Ref(B,-1)+(Z=1))+1;
Sum(V,LastValue(D+PREV*0))*X;
Sum(V,LastValue(D+PREV*0))*(X=0);
Hope this helps.
Roy
|