Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,971
Thanks: 94 times Was thanked: 156 time(s) in 151 post(s)
|
Generally speaking no you cannot have an alert fire once then disable itself.
You can use the Cross function to identify the first time a condition becomes true (after being not true) but this won't limit the expert advisor firing off an alert with each new tick if the condition remains true. An example of using the cross function would be:
X:=Mov(C,3,E)>Mov(C,5,E) AND
Mov(C,5,E)>Mov(C,8,E) AND
Mov(C,8,E)>Mov(C,10,E) AND
Mov(C,10,E)>Mov(C,12,E) AND
Mov(C,12,E)>Mov(C,15,E) AND
Mov(C,15,E)>Mov(C,30,E) AND
Mov(C,30,E)>Mov(C,35,E) AND
Mov(C,35,E)>Mov(C,40,E) AND
Mov(C,40,E)>Mov(C,45,E) AND
Mov(C,45,E)>Mov(C,50,E) AND
Mov(C,50,E)>Mov(C,60,E);
Cross(X,0.5)
|
 1 user thanked MS Support for this useful post.
|
|