Download MetaTrader 5
To add comments, please log in or register
Deposit to your account in any convenient way. There are 4 of them here!
espina88 2016.05.17 18:27 

Hello i got the next code: 

      int Ticket = OrderTicket();
      Comment("Beneficios ", Beneficios);

for trying to close an existing order, the code belongs to a function which is called just in case OrdersTotal > 0 and i have a filter which just allow 1 order at the same time.

Thats closing perfectly on strategy tester but once i test on trading demo account, having activate live trading:   Tool > Options > Expert advisor tab > Allows automated trading. Not closing :S any ideas?

whroeder1 2016.05.18 12:02  
  1. Check your return codes and find out why. Check your return codes (OrderSelect and OrderClose) 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
  2. No filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum
To add comments, please log in or register