View Single Post
  #21 (permalink)  
Old 02-02-2008, 09:00 PM
ralph.ronnquist's Avatar
ralph.ronnquist ralph.ronnquist is offline
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
If I understand it right, you want your EA to treat an unbroken series of indicator agreement as "one signal", rather than that each occasion of agreement is a signal.

One way to do so, is to make it a stateful EA and use a design as follows:
PHP Code:
static int last_signal 0;
int signal 0;
if ( <
buy conditions hold> ) signal 1;
if ( <
sell conditions hold> ) signal = -1;
if ( 
signal != && signal != last_signal ) {
    
// New signal series...
}
last_signal signal
Reply With Quote