EA Entry Only

 

Anyone can help me to solve my EA Problem

Not Open Sell, and to many order. Thanks alot

int start()
  {
     if((iFractals(NULL,0,MODE_LOWER,2)<iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)))
         OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"BUY",0,0,CLR_NONE); 
         return(0);

     if((iFractals(NULL,0,MODE_UPPER,2)>iMA(NULL,0,10,0,MODE_SMA,PRICE_CLOSE,0)))
         OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"SELL",0,0,CLR_NONE); 
         return(0);
  }
 
Epril Purwandi:

Anyone can help me to solve my EA Problem

Not Open Sell, and to many order. Thanks alot

Check what iFractals returns for the bars where a fractal does not exist and modify your code accordingly.

Check whether you already have an order open before opening a new one.


Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

 
Keith Watford:

Check what iFractals returns for the bars where a fractal does not exist and modify your code accordingly.

Check whether you already have an order open before opening a new one.


Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

Thanks

Reason: