MT5 Tester producing false "incorrect input parameters" error

 

Hi,

I have an EA that has a strategy which includes 2 integer input parameters I can change to do backtesting. So I did some tests varying between ranges I know are possible (one is a switch-case from 2 to 4, the other is a count of candle bars that have occurred since the start of the last position; really nothing fancing) and I strangely got the following scenario:

input errors

As you can see, many of the passes report " incorrect input parameter" error which, as I sad, makes no sense because I know the code allows for that variation of input. In the result summary, I have this:

results

So many passes went wrong. But here is the thing: confirming what I sad, that those values for the inputs are valid, if I right-click in any of the problematic passes and ask to run those inputs, they all work! Like the one below, which is the result of the selected line in the last picture:

good result

My diagnosys is: the Tester is somehow failiging some passes claiming one or more input parameters are wrong, when they are not. In fact, since I have some parts of my code calling for "INIT_PARAMETERS_INCORRECT", I decided to comment each one of them and do the tests again and I got the same problematic results, so it doesn't seem to be the case that any of the parts of the code where I return this kind of error is being called; is the Tester itself that is failing and reporting this error. 

So, since the input parameters I'm providing are correct and it's not my own code which is calling for "incorrect input parameters", what is doing it? Why kind of thing might be happening for the Tester to return this kind of error? How can I debug this since any time I try to run any of the problematic passes individually, everything works fine and the Tester's Diary doesn't give me any more precise information that the one presented in the first print screen? For a while I guessed it could be concurring file access since my EA loads some sqlite databases and config files, but all of it either is not loaded in Tester mode, or is in read-only mode which, AFAIK, allows for multiple file reading at the same time (example of such "read this file" moment: 

CFileTxt timeParFile;

if (timeParFile.Open(glInputs.gen.asset.timeBoundariesFileName + ".cfg",FILE_READ | FILE_COMMON) == INVALID_HANDLE)
Improperly formatted code edited by moderator.

Any help will be appreciated.

 

Forum on trading, automated trading systems and testing trading strategies

Graphical Interface no loading even though there are no errors in the expert window.

Alain Verleyen, 2024.01.30 14:34

I don't understand how you can hope to get help from your post ?

Nobody can check your code. Debug your code and find why it behaves like that. Or post ALL the relevant code if you really need help.

 
If you receive this error, you need to check your parameter input range. Otherwise, you can try compile the code to see if there are any errors or warnings. If you want help here you can post a snipped of the parameters section of the code that aligns with the test you have posted, other than that you won't be able to get assistance, we  need to see what you are struggling with.
 

Well I managed to find the problem - and, gosh, I guess it would be difficult for you to guess what it was ^^

So my guessing was more or less correct: indeed, the input variables under testing were fine and the suspect was concurring access to that config file, so I was putting some mutexes on it (despite my belief that read-only file access didn't required mutexes) when I noticed my backtestings were using not only the cores of my main PC's CPU, but also of my notebook. And what happened was that some days ago I changed the file name of that config file only in the main PC, but not of its copy in the notebook. So, as soon as I updated the notebook's file, everything return to work fine again (and without the mutexes).

So a very specific scenario problem. Anyway, thanks for your time!

Reason: