OrderSend error 130

Back to topics list To post a new topic, please log in or register
avatar
5
Lorenzo171298 2015.08.17 22: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?
Attached files:
  esempio3.mq4  (0.29 KB)
avatar
Moderator
3418
GumRai 2015.08.18 00: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
avatar
5
Lorenzo171298 2015.08.18 14:25 #
 
GumRai:
Your SL and TP are both the same. For a buy order the SL would need to be Ask-400*Point


avatar
5
Lorenzo171298 2015.08.18 14:26 #
 
Lorenzo171298:Thank you very much GumRai




Back to topics list  

To add comments, please log in or register