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

Notification

Icon
Error

Options
Go to last post Go to first unread
Lance  
#1 Posted : Tuesday, October 12, 2010 8:30:56 AM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Can some one help me write a formulae for the expert advisor?.. I would like an alert to trigger if a price bar makes a new high but closes below the close of the previous 2 price bars closes.... and visa versa if a price bar makes a new low but closes above the 2 previous price bars closes. Thank's anyone.
johnl  
#2 Posted : Tuesday, October 12, 2010 6:57:17 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
You have been a member since:: 11/7/2005(UTC)
Posts: 602


Would something like this work?

a1:=(H>Ref(H,-1))*(H>Ref(H,-2));
a2:=(C<Ref(C,-1))*(C<Ref(C,-2));
a3:=a1*a2;
a3


Lance  
#3 Posted : Thursday, October 14, 2010 5:11:07 AM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

I'll Try it and let you know. Thanx.
Lance  
#4 Posted : Thursday, October 14, 2010 5:38:42 AM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Works like a bomb for a new high and close below the two previous bars, how would I use it for a new low but closes above the two previous bars closes, would I just change the H to L in the formulae? , thanks' John, You seem to be quite good at formulae's, do you know if a formulae can be used to pick up chart patterns, Ive got the add on, but it's pretty useless...thanx for your help.

johnl  
#5 Posted : Thursday, October 14, 2010 7:30:17 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
You have been a member since:: 11/7/2005(UTC)
Posts: 602


I was going to let you do the sell side. Reverse everything including the greater/less than
symbols and post what you did if you have trouble.
Can a formulae be used to pick up chart patterns? depends on the chart pattern, what
are you trying to do?

Lance  
#6 Posted : Friday, October 15, 2010 11:56:49 AM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Thank's John. Work's just like I wanted.
Lance  
#7 Posted : Friday, October 15, 2010 12:01:54 PM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Regarding patterns, Elliot patterns with there retracements and projections(Exp Tri-angles, flats, etc),

johnl  
#8 Posted : Friday, October 15, 2010 8:42:24 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
You have been a member since:: 11/7/2005(UTC)
Posts: 602

You could post a chart showing exactly what you want, but most of that stuff is easier
programmed outside of MS is my guess.
Lance  
#9 Posted : Monday, October 18, 2010 2:57:42 AM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Thanx Bud.
henry1224  
#10 Posted : Monday, October 18, 2010 8:43:47 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
LB1:=Input("1st lookback length", 1,260,1);
LB2:=Input("2nd lookback length", 2,261,2);
A1:=(H>Ref(H,-LB1))*(H>Ref(H,-LB2));
A2:=(C<Ref(C,-LB1))*(C<Ref(C,-LB2));
A3:=A1*A2;
A4:=(L<Ref(L,-LB1))*(L<Ref(L,-LB2));
A5:=(C>Ref(C,-LB1))*(C>Ref(C,-LB2));
A6:=A4*A5;
Signal:=If(A3=1,1,If(A6=1,-1,0));
Signal
Lance  
#11 Posted : Tuesday, October 19, 2010 2:12:02 PM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

HI, I tried using your formulae, but it does'nt accept it? Do I need to add the LB lenghth? Thanks'
henry1224  
#12 Posted : Tuesday, October 19, 2010 3:00:17 PM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
the formula plots for me

just cut and paste it into the indicator builder
Lance  
#13 Posted : Thursday, October 21, 2010 5:01:03 PM(UTC)
Lance

Rank: Member

Groups: Registered, Registered Users
Joined: 11/29/2009(UTC)
Posts: 10

Thanks'Henry, sorry my mistake, I was using it in the expert advisor.
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.