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

Notification

Icon
Error

Options
Go to last post Go to first unread
nisaf  
#1 Posted : Saturday, September 27, 2008 10:30:36 PM(UTC)
nisaf

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 5/6/2005(UTC)
Posts: 6

How can I code an expert advisor that signals when the close rises above or falls below a mov avg for the 3rd time.
johnl  
#2 Posted : Sunday, September 28, 2008 8:41:59 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

First I think you have to define "from when" or "starting from what", then you can start counting
crossovers.
wabbit  
#3 Posted : Sunday, October 5, 2008 5:29:57 AM(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)
You need to specify exactly what conditions you are wanting to count, and what criteria determines when you reset the counter.

Do a search on the forum for "count and reset" and see the examples of what can be achieved.


Hope this helps.

wabbit [:D]

henry1224  
#4 Posted : Sunday, October 5, 2008 4:58:53 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)

are you looking for the 3rd consecutive close above or below a moving average?

If(Sum(C>Mov(C,50,S),3)>2,1,If(Sum(C<Mov(C,50,S),3)>2,-1,0));

minnamor  
#5 Posted : Tuesday, October 7, 2008 2:04:11 AM(UTC)
minnamor

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 4/27/2005(UTC)
Posts: 126
Location: Italy

As alsewhere in this forum:

LE:= Alert(Cross(C,ma),3) AND Sum(C>ma,3)=3 ;
SE:= Alert(Cross(ma,C),3) AND Sum(C<ma,3)=3 ;

regards

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.