Please help on: OrderSend error 3
Please help on: OrderSend error 3
This is the code:
switch(error_code) { //--- codes returned from trade server case 0: case 1: error_string="no error"; break; case 2: error_string="common error"; break; case 3: error_string="invalid trade parameters"; break; case 4: error_string="trade server is busy"; break; case 5: error_string="old version of the client terminal"; break; case 6: ....
// check for long position (BUY) possibility if(New_Bar==1 && Slope>1.57000) { ticket=OrderSend(Symbol(),OP_BUYSTOP,Lots,Ask+500*Point,30,Ask+500*Point-StopLoss*Point,Ask+500*Point+TakeProfit*Point,"Ma13",5000,expire,Green); if(ticket>0) { if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice()); } else Print("Error opening BUY order : ",GetLastError()); return(0); }
Check the parameters
Please help on: OrderSend error 3
This is the code:
Hi,
A good and recommended practice is to normalize double before sending the order :
double sl=NormalizeDouble(Ask+500*Point,Digits); double tp=Norm....
Also, some brokers on live accounts only allow EA's to place orders without stop loss and take profits and then modify the orders to the desired stop and take profit.
Hope it helps.
Also, some brokers on live accounts only allow EA's to place orders without stop loss and take profits and then modify the orders to the desired stop and take profit.
I thought that that had changed and an EA can include SL and TP in the OrderSend.
Depends on broker taste.
Depends on broker taste.
I don't think so. You can now send an order with SL/TP on any broker, independently of the usage of Instant Execution or Market Execution. I don't have checked every broker though, of course.
My broker is not fussy, so, can include SL/TP for Instant Execution or Market Execution though.
Please help on: OrderSend error 3
This is the code: