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.
|
|
|
|
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.
|
|
|
|
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]
|
|
|
|
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));
|
|
|
|
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.