I have EA's working since Jan 2013, compiled back then OK, and running in market without problem since.
However re-compile same Jan 2013 code with latest MT5 compiler, gives me errors in market.
Code has not changed.
I traced it to maybe the CTrade::FillingCheck.
This EA is using Limit orders successfully, however now it no longer works.
Using IOC and Limit orders - please help!!
If I use the EA compiled in January 2013, on live MT5, it works fine. But I want to change code and recompile!
Debug through the below code:
exec = SYMBOL_TRADE_EXECUTION_MARKET
m_request.action = TRADE_ACTION_PENDING
Meaning it passes if(exec), but then fails m_request, and gives error.
bool CTrade::FillingCheck(const string symbol)
... // lines removed here. code gets to below then jumps to error.
//--- check execution mode again
//--- for the MARKET execution mode
//--- analyze order
//--- in case of instant execution order
//--- if the required filling policy is supported, add it to the request
if(m_type_filling==ORDER_FILLING_FOK && (filling & SYMBOL_FILLING_ALL_OR_NONE)!=0)
if(m_type_filling==ORDER_FILLING_IOC && (filling & SYMBOL_CANCEL_REMAIND)!=0)
//--- wrong filling policy, set error code
When posting code please use the SRC button : How to use the SRC button.
1st post edited using SRC
Then your broker may have change the specifications of the symbol, check it by right clicking on your symbol in Market Watch, then Specification..., on get a window like this :
Is this IOC ?
It says: "Immediate or Cancel"
Expiration is: GTC, Today, Specified
Orders is: All
The old code in .ex5 / binary form from Jan 2013, works fine.
If i take the code, and recompile, it gives me filling error - same broker, same terminal, same code but newer compile date
Ok, will do.
Maybe it has something with the EXECUTION_MARKET bit, that is new since Jan 2013 yes?
- here is call to CTrade object
also debugger shows IOC (below)