Help with iAlligator function

To add comments, please log in or register
don per
126
don per  

In my mql code, I want to make the bequal variable true when the jaws and teeth of the iAlligator indicator are equal. So I wrote the following code. Unfortunately, it never makes the variable true, even when the jaws and teech are equal. I am not sure why the problem is. Could anyone help please?

   double curr_jaw= iAlligator( NULL,0,J_Period,J_Shift,T_Period,T_Shift,L_Period,L_Shift,MODE_SMMA,PRICE_CLOSE,MODE_GATORJAW,1);

   double curr_teeth= iAlligator( NULL,0,J_Period,J_Shift,T_Period,T_Shift,L_Period,L_Shift,MODE_SMMA,PRICE_CLOSE,MODE_GATORTEETH,1);

   if (curr_jaw==curr_teeth)

   {

      bequal=true;

      SendMail("Jaws and Teeth are equal",Symbol()); 

   }

In the beginning of my code, I already declared bequal after my extern variables

bool bequal=false;


I am not not why this code is not working. Any help is greatly appreciated.

Ernst Van Der Merwe
5806
Ernst Van Der Merwe  

Doubles are very rarely equal.

   if (MathAbs(curr_jaw-curr_teeth)<Point*10)

   {

      bequal=true;

      SendMail("Jaws and Teeth are equal",Symbol()); 

   } 
   
   else
   
      bequal=false;
To add comments, please log in or register