I make an EA for hectic market (specially nfp) long time ago. It was works just fine.
But then i need to change some of the variables. And after i compile it, i can't run it again.
I try to run another old EA, it works. Then i try to recompile it, it doesn't works.
The error i got is " 'ea_name' is not expert and cannot be executed " in my metatrader.
Then i browse the internet to find what is wrong with my EA, then i know that there is some change in mql code.
So i try to change my EA code, until i got no error. But the EA still doesn't work, and i still got the error " 'ea_name' is not expert and cannot be executed ".
What is wrong with my EA?
Below is my attached EA. The ea_old is my original EA, the ea_new is my editted EA.
Remove this line :
Hello, sorry for the late reply.
Thank you very much for your reply, my EA is work now. But i don't know why i still get the error "return value of 'OrderSelect' should be checked" and all OrderETC on my ea_old.mq4, is this ok?
No need to be sorry, it's a forum, not a chat
These are warnings. It could be ok, but it's a good practice to check the returned value of functions. See Common Errors in MQL4 Programs and How to Avoid Them
Usually you can silence that warning by telling the program what to do if OrderSelect fails :
if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==false) //or if( !OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES) , same thing
Print("Failed to select order, error : "+GetLastError()); // if it fails , print, if not , keep going
Hope it helps