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

Notification

Icon
Error

Options
Go to last post Go to first unread
lawmans3  
#1 Posted : Monday, August 7, 2006 9:36:14 PM(UTC)
lawmans3

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/26/2006(UTC)
Posts: 6

Hello All,

I created the following indicators based on Phil Town's book Rule #1. They work but give different results. The cross formula only gives about 2-3 buy signals where the <> formula gives a bunch. I'm pretty new to this so can someone tell me why they don't give the same indications? I would think if the <> formula is true the cross formula would also be true? But it's not so I know the flaw is in my understanding of it. I have been testing these on Ebay. Here is the formula:

3 signal buy}
macdv:=Mov(C,8,E)-Mov(C,17,E);

macdv>Mov(macdv,9,E) AND
Stoch(14,5)>Mov(Stoch(14,5),5,S) AND
C>Mov(C,10,S);

{Sell}

macdv < Mov(macdv,9,E) AND
Mov(Stoch(14,5),5,S)>Stoch(14,5) OR
macdv < Mov(macdv,9,E) AND
C<= Mov(C,10,S) OR
Mov(Stoch(14,5),5,S)>Stoch(14,5) AND
C<= Mov(C,10,S);

=============================

{3 signal buy}
macdv:=Mov(C,8,E)-Mov(C,17,E);

Cross(macdv,Mov(macdv,9,E)) AND
Cross(Stoch(14,5),Mov(Stoch(14,5),5,S)) AND
C>Mov(C,10,E);

{Sell}

Cross(Mov(macdv,9,E),macdv) AND
Cross(Mov(Stoch(14,5),5,S),Stoch(14,5)) OR
Cross(Mov(macdv,9,E),macdv) AND
C<= Mov(C,10,E) OR
Cross(Mov(Stoch(14,5),5,S),Stoch(14,5)) AND
C<= Mov(C,10,E);

============================

Any help or comments are much appreciated!

wabbit  
#2 Posted : Monday, August 7, 2006 10:25:03 PM(UTC)
wabbit

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)

lawmans

The Cross() function identifies a SPECIFIC event in time e.g. the price has to be below the MA on one bar and above the MA on the very next bar. A Cross() has occurred on this bar.

The <> "not equal to" function is a lot more common e.g today the price is below the MA so they are not equal, the next bar the price is above the MA so they are not equal. The only time this code will 'fail' will be when the price exactly equals the MA (a rare event as MAs are usually computed to at least 4 decimal places and most prices only about 2 decimal places, except penny dreadfuls!)

The Cross() function also has some 'bugs' in it that means it does not trigger when logically you'd think it should have, but does trigger sometime when you think it shouldn't have. This is why you see a lot more people taking charge of the crossovers using code like:

x:=C>Mov(C,20,S);
x and Alert(x=0,2);

which says to trigger a crossover event if today the price is above the MA, but yesterday the price could have been less than or equal to the MA. Cross() sometimes has difficulties with the 'less than or equals' scenario.

Personally, I'd be using something like this :

{3 signal buy}
macdv:=Mov(C,8,E)-Mov(C,17,E);
trigger:=Mov(macdv,9,E);

x:=macdv>trigger;
criteria1:=x and Alert(x=0,2);

stch:=Stoch(14,5);
stchMA:=Mov(Stoch(14,5),5,S);

y:=stch>stchMA;
criteria2:=y and Alert(y=0,2);

crtieria1 AND criteria2 AND C>Mov(C,10,E);

Hope this helps

wabbit [:D]

lawmans3  
#3 Posted : Tuesday, August 8, 2006 7:26:11 PM(UTC)
lawmans3

Rank: Newbie

Groups: Registered, Registered Users
Joined: 7/26/2006(UTC)
Posts: 6

Hi Wabbit,

Thank you for your help! You lost a little on the 'Alert' function as I’m not familiar with it. I will have to try to read up on its use. I will experiment with your suggestions though!

Take care....mitch

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.