Candlesitck above averege

 

Heey. This forum is GREAT!!!! Tanks Brothers!
I'm new to MQL, and I'm a big doubt.
the code below inserts a market order if the sale price and the purchase is above or below the average.
I would like to know how to make a candle is above or below average send the order. 

 Sorry if there are gross errors of English!

 

MA=iMA(NULL,0,MA,0,MODE_EMA,PRICE_CLOSE,0);

  if(OrdersTotal()<4)
     {

      if(Bid<MA)
        {;
         OrderSend(Symbol(),OP_SELL,Lots,Bid,10,0,0);
         CurrentOrder++;
           } else if(Ask>MA){
         OrderSend(Symbol(),OP_BUY,Lots,Ask,10,0,0);
         //CurrentOrder++;
        }
 
KeepMarcos:

Heey. This forum is GREAT!!!! Tanks Brothers!
I'm new to MQL, and I'm a big doubt.
the code below inserts a market order if the sale price and the purchase is above or below the average.
I would like to know how to make a candle is above or below average send the order. 

 Sorry if there are gross errors of English!

 

 


MA=iMA(NULL,0,MA,0,MODE_EMA,PRICE_CLOSE,0);

if(OrdersTotal()<4)
  {
   if(High[0]<MA)
     {
      OrderSend(Symbol(),OP_SELL,Lots,Bid,10,0,0);
      CurrentOrder++;
     }
   else if(Low[0]>MA)
     {
      OrderSend(Symbol(),OP_BUY,Lots,Ask,10,0,0);
      //CurrentOrder++;
     }
  }
 
zirkoner:

Thanks Sr!!!!
Reason: