Download MetaTrader 5

Script Error - No Trades Are Opening - AutoTrading Enabled

To add comments, please log in or register
Do you often publish source codes? Find out how to do that correctly!
nazty 2016.10.18 02:33 


I have recently started to have a problem with my scripts.  


I am currently running a script that lets you open several trades at once on multiple currency pairs.  

I have enabled autotrading everywhere and when I try to run the script no trades open.  

I get no error in the journal tab and I have no idea what to do to fix the problem.  


Any help would be greatly appreciated.


Thank you.   

nazty 2016.10.18 02:43  
I believe that it is a problem because I have an ECN broker, but I just do not know how to solve it.
Keith Watford
Keith Watford 2016.10.18 05:17  
if (ticket > -1) TradesSent++;
else Print("Error ",GetLastError());

Print out errors to see why.

whroeder1 2016.10.18 12:55  
  1. Error 4073 - No history data
    Error 4066 - Requested history data is in updating state
    You do not handle either. Get all Ask values, verify and wait until you have no errors, then try to open. Anyone know how to develop a multicurrency indicator ? (Wemerson Guimaraes) - MQL4 forum - Page 2
  2. Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
Mary Clark
Mary Clark 2016.10.27 02:17  

Try  changing the NULL to 0.


  int ticket = OrderSend("GBPUSD",OP_BUY, Lot, MarketInfo("GBPUSD",MODE_ASK), 2, NULL, NULL, TradeComment, MagicNumber, 0, CLR_NONE);

-- change to this

  int ticket = OrderSend("GBPUSD",OP_BUY, Lot, MarketInfo("GBPUSD",MODE_ASK), 2, 0, 0, TradeComment, MagicNumber, 0, CLR_NONE);

if (ticket < 1)


To add comments, please log in or register