Logfile grows until infinity

 

I have written a simple EA which should close an open position once there is an EMA-crossing in the opposite direction (as part of a bigger program, but I want to take one step after the other to make sure there are no hidden mistakes). After about 2 hours the log file grows to about 25GB !!! - Is there any way to limit the size of the logfile or not to have it at all?

I add the EA. Maybe someone can tell me what I have done wrong. I want to run it mainly on a 4 hourly chart, but it can be changed (external variable).

Files:
 

What are the repeated entries in the log-file saying?


CB

 
kajasi wrote >>

I have written a simple EA which should close an open position once there is an EMA-crossing in the opposite direction (as part of a bigger program, but I want to take one step after the other to make sure there are no hidden mistakes). After about 2 hours the log file grows to about 25GB !!! - Is there any way to limit the size of the logfile or not to have it at all?

I add the EA. Maybe someone can tell me what I have done wrong. I want to run it mainly on a 4 hourly chart, but it can be changed (external variable).

You are deleting orders in a loop. The only way for the ea to get out of the loop is if the delete / close function was successful. If it is not, the ea stays in the loop and keeps on trying to delete / close. Try adding getlasterror().

Also, don't wait 2 hours before you look at the log file. Look in it after 1 minute to see what your ea is doing.

whocares