Download MetaTrader 5
To add comments, please log in or register
Do you need a programmer? Make an order to let the developer find you!
moonsboy
889
moonsboy 2014.10.15 10:05 
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.
whroeder1
13602
whroeder1 2014.10.15 14:22  
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()
moonsboy
889
moonsboy 2014.10.16 03:36  
I undersood start() is same as OnStart(). May I know the difference?
moonsboy
889
moonsboy 2014.10.16 03:44  
Besides above question, when to use start() and when OnTick()?
Carl Schreiber
5938
Carl Schreiber 2014.10.16 06:13  
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
whroeder1
13602
whroeder1 2014.10.16 12:42  
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.
moonsboy
889
moonsboy 2014.10.25 01:40  
when should I use start() and when to use OnTick()? Or are they same to use?
Carl Schreiber
5938
Carl Schreiber 2014.10.25 06:13  

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.

moonsboy
889
moonsboy 2014.10.28 07:21  
Dears, when should I use start() and when to use OnTick()? Or are they same to use?
Carl Schreiber
5938
Carl Schreiber 2014.10.28 08:19  
I would use the new one, use OnTick().
/
To add comments, please log in or register