Hi, I am new to MQL4 programming. I am trying to add code to my EA using fractal. The condition is if there is NOT Up Fractal in last 4 bars , it should open BUY trade..Here code compiles without Error but it is NOT opening trade…Regards..
here’s the code:
bool Upfractal()
{
int a;
for(a=1;a<5;a++)
{
if(iFractals(NULL,0,MODE_UPPER,a)!=0)
return(true);
}
return(false);
}
void ManageOpen()
{
if(Upfractal()==false)
{
OpenPosition(OP_BUY);
}
}