Download MetaTrader 5

OrderSend error 3 plz help buystop do not open

To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Mahfoud Allali
324
Mahfoud Allali 2015.09.14 16:22 
//+------------------------------------------------------------------+
//|                                                            1.mq4 |
//|                                                   Imperial Blaze |
//|                                         www.facebook.com/m4hfoud |
//+------------------------------------------------------------------+
#property copyright "Imperial Blaze"
#property link      "www.facebook.com/m4hfoud"
#property version   "1.00"
#property strict

extern double lots = 0.1;
extern int takeprofit = 1500;
extern int stoploss = 2000;
extern int magic = 4488;
extern int zr = 500;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   openbuy();
   openbuystop();   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

 
  }
//+------------------------------------------------------------------+

void openbuy()
{
OrderSend(Symbol(),OP_BUY , lots , Ask , 3 ,Ask-stoploss*Point , Ask+takeprofit*Point , NULL , magic , Blue);
}

void openbuystop()
{
OrderSend(Symbol(),OP_BUYSTOP , lots , Ask+zr , 3 ,Ask+zr-stoploss*Point , Ask+zr+takeprofit*Point , NULL , magic , Blue);
}
Trinh Dat
37203
Trinh Dat 2015.09.14 19:09  
OrderSend(Symbol(),OP_BUYSTOP , lots , Ask+zr*Point , 3 ,Ask+zr*Point-stoploss*Point , Ask+zr*Point+takeprofit*Point , NULL , magic , Blue);
Mahfoud Allali
324
Mahfoud Allali 2015.09.14 21:44  
Trinh Dat:
Thanks for the answer
I had a really errors in writing code
But the error still exists ''OrderSend error 3"
Files:
Sans_titre.png 192 kb
Trinh Dat
37203
Trinh Dat 2015.09.15 03:17  
void openbuystop()
{
OrderSend(Symbol(),OP_BUYSTOP , lots , Ask+zr*Point , 3 ,Ask+zr*Point-stoploss*Point , Ask+zr*Point+takeprofit*Point , NULL , magic ,0, Blue);
}
Mahfoud Allali
324
Mahfoud Allali 2015.09.16 18:58  
Trinh Dat:

thank you :D

To add comments, please log in or register