Just want clarification...Is the only difference between an EA and a script, is the location of the "file" ?

 

I am a newbie to MQL4 and developing a trade strategy. 

I have written some code, and I want to use a script to generate the orders, and an EA to employ a Trailing stop. 

I have been reading a lot of the posts in this forum, but I just want to make sure my code is going to perform as expected.

On a related note, does my EA need to employ a defined "while" loop, or will it execute automatically on every tick ?

Thanks for your input. 

 
Eagle953:

I am a newbie to MQL4 and developing a trade strategy. 

I have written some code, and I want to use a script to generate the orders, and an EA to employ a Trailing stop. 

I have been reading a lot of the posts in this forum, but I just want to make sure my code is going to perform as expected.

On a related note, does my EA need to employ a defined "while" loop, or will it execute automatically on every tick ?

Thanks for your input. 

 


Which EA ?


Start() function is execute on each tick (almost).

 
Eagle953:

I am a newbie to MQL4 and developing a trade strategy. 

I have written some code, and I want to use a script to generate the orders, and an EA to employ a Trailing stop. 

I have been reading a lot of the posts in this forum, but I just want to make sure my code is going to perform as expected.

On a related note, does my EA need to employ a defined "while" loop, or will it execute automatically on every tick ?

It's in the Documentation and the Book
 
angevoyageur:

Which EA ?


Start() function is execute on each tick (almost).

 

So, if my ".ex4" file is located in the "...experts\scripts"  directory, it will only run once, but if it is located in the "...experts"  directory, it will run like an EA ?

 
Eagle953:

So, if my ".ex4" file is located in the "...experts\scripts"  directory, it will only run once, but if it is located in the "...experts"  directory, it will run like an EA ?

 

Try it and see . . .  but yes I think it will.
 
RaptorUK:
Try it and see . . .  but yes I think it will.

Ok, will definitely try it and reply back so people will know.

Thank you for your input.

 
Eagle953:

Ok, will definitely try it and reply back so people will know.

Thank you for your input.

 


The answer is....

if your ".ex4" is in the "...expert/scripts" directory, it runs only once

Reason: