View Single Post
  #22 (permalink)  
Old 02-02-2008, 09:13 PM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,218
matrixebiz is on a distinguished road
Quote:
Originally Posted by ralph.ronnquist View Post
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
Hi Ralph, maybe this thread I started will be more clear;
Please check my Simple EA

Thanks
Reply With Quote