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

Notification

Icon
Error

Options
Go to last post Go to first unread
reddog  
#1 Posted : Saturday, September 1, 2007 2:55:18 AM(UTC)
reddog

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/22/2007(UTC)
Posts: 16

I'm only new to Metastock and I've been examining one of Jose's downloads (Pattern 01) from Metastocktools.com.

I understand the first half, but I'm not sure about the rest. (from Init:= to the end)

Hopefully someone can give me a few clues.

My interpretation is that:

The remainder of the script is to ensure that there are not 2 "in" signals before an "out" signal

In: and Out: can only be 1 or 0

Therefor init: can only be true when both In: and Out: =1

From there on I'm pretty well stumped.

x:=Input("Consecutive Lower Closes - Entry",0,21,5);
y:=Input("Consecutive Higher Closes - Exit",0,21,5);
delay:=Input("Entry and Exit delay",0,5,0);
plot:=Input("signals: [1]Clean, [2]All",1,2,1);

In:=Sum(C<Ref(C,-1),x)=x;
Out:=Sum(C>Ref(C,-1),y)=y;

Init:=Cum(In+Out>-1)=1;
InInit:=Cum(In)=1;
flag:=BarsSince(Init OR In)<BarsSince(Init OR Out)+InInit;
signals:=(InInit AND Alert(InInit=0,2) OR flag AND Alert(flag=0,2))-(flag=0 AND Alert(flag,2));

Also, when I'm confused when trying to run the script in expert advisor.

If I create a buy signal using the In: variable, I get multiple buy signals before a sell signal.

If I use the entire script in the buy formula, I get a buy signal on every bar.

Do I have to introduce a latch into my exploration or am I doing something wrong?

Thanks for your help

reddog  
#2 Posted : Sunday, September 2, 2007 3:25:54 PM(UTC)
reddog

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/22/2007(UTC)
Posts: 16

Sorry I was referring to the Enhanced System Tester (not expert advisor).

I think I've worked out the code....It is an initialisation latch for the first bar of data.

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.