Download MetaTrader 5
To add comments, please log in or register
MQL5.community allows users to store their source codes in MQL5 Storage. Try it!
nazty
11
nazty 2016.10.18 02:33 

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:
nazty
11
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
Moderator
8026
Keith Watford 2016.10.18 05:17  
if (ticket > -1) TradesSent++;
else Print("Error ",GetLastError());

Print out errors to see why.

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

  

  
/
To add comments, please log in or register