Writing EA

To add comments, please log in or register
pekele4u
10
pekele4u  
I am new to mql4 programming. I have watched alot of video of mql4 programming and i am ready to start developing my own but my challenge is that when I create a new file I dont see the Start() function as i saw it in the video but I am see OnTick(), OnInit(). Has the Start() function been removed and replaced with OnTick() function
Marco vd Heijden
Moderator
10793
Marco vd Heijden  

So you use the OnTick() or OnTimer() function instead.

Start() is depreciated except for in scripts. 

So you have usually 3 elements.

OnInit() // this runs only once upon loading the EA

OnTick() // this runs on every new incoming tick

OnDeinit() // this runs only once upon unloading the EA

And a fourth is OnTimer() this runs upon a set interval.

pekele4u
10
pekele4u  
Marco vd Heijden:

So you use the OnTick() or OnTimer() function instead.

Start() is depreciated except for in scripts. 

So you have usually 3 elements.

OnInit() // this runs only once upon loading the EA

OnTick() // this runs on every new incoming tick

OnDeinit() // this runs only once upon unloading the EA

And a fourth is OnTimer() this runs upon a set interval.

Thanks, your comment was very helpful.
William Roeder
18658
William Roeder  
You should stop using the old event handlers and IndicatorCounted and start using the new ones.
          Event Handling Functions - Functions - Language Basics - MQL4 Reference
To add comments, please log in or register