Builds higher than 660 cluttering up HD with log files and slower optimization speed - page 3

 

The log file directory is always there in the /tester directory, it just might be the case that yours is in the UserData folder since I am using MT4 in /portable mode.

Yes, you can start the tester via command line, but that doesn´t help any, the logging is done program-internal since build 670, no way to turn it off by a command line.

Redirecting the output to NUL has nothing to do with the internal logging. All your idea would do is to redirect the output of a command prompt box to nul (the actual text output that is). For a application with a GUI like MT4 that does absolutely nothing.

 

More fun with the logs!



 

hmm - one of my brokes updated to b765 - may be this version has lost this 'feature'?

Use a powershell script that immediately deletes all the log files in your folder in time?

NOT TESTED!!

$path = "C:\Program Files\MetaTrader\tester\logs"   # correct path?
while($true) {                                      # endless loop switch off manually!!
    $files = Get-ChildItem -Path $path |  Where-Object {-not $_.PsIsContainer -and $_.name -like "*.log"}
    foreach ($file in $files) {                     # Folder are excluded
       Remove-Item $file.FullName -Force -ErrorAction SilentlyContinue  
    }
    Start-Sleep -s 60                               # sleep 60 seconds 
}
 
OK, I will check out B765. As said, the log files are locked by metatrader.exe while it runs, you can´t delete them without closing the terminal first, which would cancel the actual optimization.
 

Therfore this:

Remove-Item $file.FullName -ErrorAction SilentlyContinue  

Files that couldn't be removed are 'Silently[..]' bypassed and deleted the next time.

I think you can remove -Force (so I did).

 
But "the next time" is to late as this would mean after a terminal-restart (once files are unlocked), in which case the HD would already be full (which is my actual problem). "Force" doesn´t work either, I tried, but as I said, the files are locked by Metatrader until the Terminal is shut down and your script hence fails.
 

NO! next time meant after the 60 sec sleep! Haven't I written it??

Every minute the script looks for logs to be deleted!

As - my guess - a test-run only blocks 1 log-file, the previously created can be deleted - but try it yourself.

I can't as I have nothing to optimize right now..

 
mt4user2000:

What do you mean? The logs I am talking about log each SL that occurred during the optimization for each pass of the optimization. I posted them already, so what is needed to be interpreted differently in these? It clearly shows what it logs and that actually isn´t the problem at all, the problem is THAT it logs at all while it should not during the optimization as it clutters up the harddisk.

You are not reading other peoples posts.

I posted my logs from which you can see that i am using stoploss and that stoploss is getting triggered by the system. I also stated under what builds i have done tests.
But you are asking same questions already answered.

And in the same time you are publishing large logs containing no information.

 

mt4user2000:

And might I rather suggest that you learn how to actually FIND logs? X posts long you are telling me "no, there is nothing logged" in build 670 and 745 and now out of sudden you say it logs on your system as well? LOL

I already told you that this behaviour is somehow triggered and that it obviously needs some other factor beside genetic optimization to show.

But it is more easy and convenient to write LOL LOL  than to read and try to understand. 

 

Also, what is you problem? Remove the SL and exit trades with OrderClose().

By your writing it is obvious that you are aware that MQ doesn't care about this or any other minor bugs. 

 

graziani,

this is not the most proper workaround, but you could try to deny metatrader.exe from writing to the log directory by editing the ACL's on the log dir.

caution: only do this when you know what you're doing.

greetings

 

graziani: sorry, I wont´comment further on your posts.

gooly: yes I know what you mean, but it still can´t delete the log files, they are locked and it doesn´t work hence. Just try yourself.

ics-mq4: this is something I tried as well and it works, but it slows down optimization by a factor of 10 unfortunately. Most likely because Metatrader is getting bombed with errors as it can´t write to the directory and retries a few times before giving up. Another trick also is to delete the "logs" directory and create a file by the same name in which case Metatrader can´t create the "logs" directory anymore as well. But the same happens in that case, heavy slow down of the optimization.

Reason: