Download MetaTrader 5
To add comments, please log in or register
Are you a real pro? Share your knowledge with millions of traders!
hongguang yin
356
hongguang yin 2014.10.14 16:14 

The same EA works fine on Instaforex and ICMarkets. but it does not work when I attached the EA to the charts of BTG MT4. I put a Print just before OrderSend() function, the print message shows buy/sell signals are generated as expected, but the OrderSend() mysteriously stops working.  Autotrade is enabled. the broker confirmed there is no problem at his end. Could this be a bug?

screenshot 

Bogdan Alin Baltatu
2739
Bogdan Alin Baltatu 2014.10.14 18:10  

Your code is wrong..

In case of erro ticket is -1

Returns number of the ticket assigned to the order by the trade server or -1 if it fails. 
hongguang yin
356
hongguang yin 2014.10.15 01:19  
Thanks for pointing this out, but OrderSend() still does not work
SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.10.15 01:38  

I also have problem where one EA works for certain broker but not for other broker. It can be lot problem, spread problem, currency pair problem, etc as the list can keep going on.

However, for me, the only problem that I manage to catch is the digit (dot after zero) problem and currency pair symbol used problem. I fix it and it works again.

hongguang yin
356
hongguang yin 2014.10.15 02:57  

I have the following code in place, so the problem should not be spread or digits.

 if (Digits == 5||Digits == 3)

            pt = 10*Point;

  else

            pt = Point;

  slip = MathCeil((Ask - Bid)/pt); 

hongguang yin
356
hongguang yin 2014.10.15 04:20  
Problem solved. the broker does not allow lot size of 0.01
/
To add comments, please log in or register