Download MetaTrader 5
To add comments, please log in or register
Develop trading robots to order. Make profit with Freelance service!
Keep Marcos
120
Keep Marcos 2016.02.10 18:02 

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++;
        }
Zirkon
123
Zirkon 2016.02.12 11:26  
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++;
     }
  }
Keep Marcos
120
Keep Marcos 2016.02.14 04:07  
zirkoner:

Thanks Sr!!!!
/
To add comments, please log in or register