Converting EA to Script

 
Hello

Can someone help me how to convert EA to Script ?

and also what is the difference between EA and Script programming structure ?


thank you
 

Copy or move the EA's mq4 file from /experts to /experts/scripts

Script runs only one time, so you need to enclose the EA code in a loop

Also, you need to pause the loop ... the Sleep command .... or your Script/EA will run continuously -> 100% CPU

try:

int start(){

while(!IsStopped()){

... Insert the original EA code that executes on each tick...

Sleep(100); // The "EA" will execute 10 times per second

}

return(0);

}

Reason: