can anyone tell me how an Expert Advisor run its code?

 
i've been doing an EA until now when i realised something simple that seems to be important how does an expert advisor work? it only run the code we programmed every tick / price move? or just does it run every new bar come out? or every seconds?
 

init() runs once at start or when you change TimeFrames or parameters, deinit() runs once when the EA closes, start() runs once for each tick . . . as long as it can do what it needs to do within that tick.

Some info here: https://docs.mql4.com/basis/functions/special & https://docs.mql4.com/runtime/start

 
hi raptor, thanks for helping me again...have been reading through the article anyway, seems like i'm facing so much trouble in finding the code i'd like to implement according to my strategy. I would be happy to share it with you once i can implemented it If this is a pain in the, well you know, i certainly do not want to make you put a lot of time into it... But if it something that is not too difficult... Let me know if you have some time, thanks raptor..
 
lucif:
Let me know if you have some time, thanks raptor..

I have some time to help out here . . . I'm by no means an expert though, I'm here to learn just like everyone else is (or should be ;-) ).

The first thing you need to do is make sure you understand your Strategy . . . generally what people label as discretionary or intuition is just another way of describing something that they don't fully understand. If you don't understand how you do what you do then you have no chance of ever coding it . . .