Why are the most EAs in code base Scripts? Can script work as EA?

 
When you open the EAs from code base, you can see the main fuction is onstart() instead of ontick(). So I'm confused how the EA can work normally without ontick(). How can script work as EA? Could anyone please advise or comment? Thanks.
 
jollydragon: When you open the EAs from code base, you can see the main fuction is onstart() instead of ontick().So I'm confused how the EA can work normally without ontick(). How can script work as EA? Could anyone please advise or comment? Thanks.
  1. Your premise is wrong. I went to codebase/experts: Download forex robots for free for MetaTrader 4 in MQL5 Code Base and looked at the first 4 EA's
  2. EA's must have a OnTick() or start(). Scripts must have a OnStart() or start()
  3. Scripts run once. Gone once they return from OnStart() or start()
 
I undersood start() is same as OnStart(). May I know the difference?
 
Besides above question, when to use start() and when OnTick()?
 
jollydragon:
I undersood start() is same as OnStart(). May I know the difference?
start() was the function before b600+ OnStart or OnTick() are the actual versions
 
jollydragon: I undersood start() is same as OnStart(). May I know the difference?
  1. If they're the same how can there be a difference?
  2. Read the documentation. Event Handling Functions - MQL4 Documentation it answered that in the first line of the second paragraph.
The OnStart() function is the Start event handler, which is automatically generated only for running scripts.
 
when should I use start() and when to use OnTick()? Or are they same to use?
 

If you press on +New in you editor you have to select EA, Indi., Script, .. take the functions that will be there, then you are correct!


Old code can you leave as it is unless there is nor error when you compile it.

 
Dears, when should I use start() and when to use OnTick()? Or are they same to use?
 
I would use the new one, use OnTick().
Reason: