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.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 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
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/29/2009(UTC) Posts: 10
|
I'll Try it and let you know. Thanx.
|
|
|
|
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.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 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?
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/29/2009(UTC) Posts: 10
|
Thank's John. Work's just like I wanted.
|
|
|
|
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),
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 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.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 11/29/2009(UTC) Posts: 10
|
|
|
|
|
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
|
|
|
|
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'
|
|
|
|
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
|
|
|
|
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.