EA wont attach to the chart

 

hello my friends,

i have developed an EA for the first time. it took me about 6 mounts to built it.

now that its over and compiled , i see that it dose not attach to the chart.

in fact it dose not even open the small window , that always opens before attaching EAs.

also every other EA that i had before works perfectly. so my platform is not the problem.

dose anyone have an idea how to fix this problem?

 

also in the tab of "experts" it says " 2021.04.13 11:45:51.556 'EA_min' is not expert and cannot be executed ".

what is its mean? it is an EA. i could compile it. 


 

Do you use "OnTick()" or "start()" function as entry point?

I had some old EA-s that wouldn't attach to chart with the same message you got. When I replaced start() with OnTick() they continued to work.

OnTick() is the recommended since the big change in 2014.

Also add #property strict if you don't have it. It will help you catch possible bugs.

 

yes. thank you my friend. it was the onTick() as you say.

this part is not in the book. even in the page that tells us whats new in mql4 they say that we can use "start() and OnStart() and OnTick().

but as you know only OnTick() works for EA.

thank you.

 

As a general rule, mql4 programs should use event functions from the documentation:  Client Terminal Events. That version is 7 years old now.

Old event functions still work because of backward compatibility with older versions of MT4.

Those functions can be completely removed in future if they find a bug, or some security issue and if the easiest solution is to remove old versions.

Client Terminal Events - MQL4 programs - MQL4 Reference
Client Terminal Events - MQL4 programs - MQL4 Reference
  • docs.mql4.com
Client Terminal Events - MQL4 programs - MQL4 Reference
Reason: