Script Error - No Trades Are Opening - AutoTrading Enabled

 

Hello.  

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.   

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

Print out errors to see why.

 
  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
 

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)
   Print(GetLastError());

  

  
Reason: