Download MetaTrader 5

MT5 testing

To add comments, please log in or register
Paul
64
Paul 2012.06.11 12:49 

Despite several attempts and re-downloading the latest versions, I'm still unable to get a successful test on the example experts supplied with MT5. I always receive the following errors (example)

failed market buy 0.79 EURUSD [Unsupported filling mode]

CTrade::OrderSend: market buy 0.79 EURUSD [invalid fill]

Is the tester broken or do I need to set it up differently?

 

Regards, Paul.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
Paul
64
Paul 2012.06.18 07:34  

To answer the question myself in case anyone else is having the same trouble...

I think the broker's server may be set up differently in some cases but the following has solved my issues. In the file ExpertTrade.mqh are two functions, bool CExpertTrade::Buy & bool CExpertTrade::Sell. I have added the following line of code in each of these functions immediately after the line

stops_level=m_symbol.StopsLevel()*m_symbol.Point();

 add this:

SetTypeFilling(ORDER_FILLING_IOC);

 Re-compile this file and also any code units that reference it and, in my case anyway, the tester now places orders correctly.

Regards, Paul.

 

To add comments, please log in or register