logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mstt  
#1 Posted : Tuesday, May 19, 2015 9:46:24 PM(UTC)
mstt

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)

To Jamaan

Please delete some or all of your MetaStock Forum mailbox messages so that I can replay to your PM. Alternatively you could email me at rlarsen@quik.co.nz. Thank you.

Roy (mstt)

mstt  
#2 Posted : Wednesday, May 20, 2015 5:07:51 AM(UTC)
mstt

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

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.