Alert Code for Laguerre

 

Hello Friends,

I am hoping to develop an EA to generate alerts based on Laguerre indicator. This indicators goes from 0 to 1 and my requirement is to have an alert pop up when it touches 0 or 1 and starts to retrace at 0.25 or 0.75. Can someone please give me pointers on how can I achieve this.


I would really appreciate any help, comments and recommendations.


Regards

 

the_one

Your EA could use a function like this

int LaguerreCheck()
  {
   // Returns 1 for a BUY, 2 for a SELL


double Laguerre1 = iCustom(NULL, 0, "Laguerre", 0, 1);
double Laguerre2 = iCustom(NULL, 0, "Laguerre", 0, 2);


     if ((Laguerre1 > Laguerre2) && (Laguerre2 == 0.00)) //Start up trend
       {return(1);}
       
     if ((Laguerre1 < Laguerre2) && (Laguerre2 == 1.00)) //Start down trend
       {return(2);}

return(0);

  }

Keep in mind that Laguerre looks great on historical data but repaints rather badly in real time :(

I wouldnt use this on its own - I might use it in conjunction with several other indicators for confirmation...

FWIW

-BB-

 
BarrowBoy:

the_one

Your EA could use a function like this

Keep in mind that Laguerre looks great on historical data but repaints rather badly in real time :(

I wouldnt use this on its own - I might use it in conjunction with several other indicators for confirmation...

FWIW

-BB-

Hi BB,

Thanks for your quick response. You are right about using some other indicator along with Laguerre. At this stage I only need an EA which can alert me when Laguerre reach the Max/Min and then start to retrace.


In the code you specified how would it know if indicator has reached Max/Min and started to come back to 0.75/0.25. If it is not too much ask can you please help me code the rest of the EA.


Thanks in advance.