Download MetaTrader 5
To add comments, please log in or register
Sign up for MQL5.community to leave your comments!
Lorenzo Bagattini
16
Lorenzo Bagattini 2015.08.17 20:37 
Hi, I made my first EA but I don't understand why it doesn't work. The Strategy Tester give the answer OrderSend error 130 and I don't know what do to correct the code. Please, can you help me?
Files:
esempio3.mq4 1 kb
Keith Watford
Moderator
7887
Keith Watford 2015.08.17 22:26  
void start()
  {
   double Average=Average();
   if(Ask<Average)
    {
     OrderSend(Symbol(),OP_BUY,1,Ask,30,Ask+400*Point,Ask+400*Point);
    }
   return;
  }

double Average()
  {
   double a = (Close[0]+Close[1]+Close[2]+Close[3]+Close[4])/5;
   return (a);
  }
Your SL and TP are both the same. For a buy order the SL would need to be Ask-400*Point
Lorenzo Bagattini
16
Lorenzo Bagattini 2015.08.18 12:25  
GumRai:
Your SL and TP are both the same. For a buy order the SL would need to be Ask-400*Point
Lorenzo Bagattini
16
Lorenzo Bagattini 2015.08.18 12:26  
Lorenzo171298:Thank you very much GumRai


/
To add comments, please log in or register