Backtesting question - loading files

 

Hi there,

I've been backtesting strategies for a few months now and ran into a new issue today.

Namely, until today, whenever I changed the code, saved it and started a backtest on the same file, the last saved file was loaded for backtesting.

Until today:

New file FileA created, parameter value set to 3, FileA saved.
- When initiating backtest, parameter value 3 used.

Parameter value changed to 5, FileA saved.
- When initiating backtest, parameter value 5 used.

Parameter value changed to 6, FileA saved.
- When initiating backtest, parameter value 6 used.


However, starting from today, when initiating backtesting, it doesn't recognise that the code has been updated and always the initial file is loaded (not the file that was resaved).

Starting from today:

New file FileA created, parameter value set to 3, FileA saved.
- When initiating backtest, parameter value 3 used.

Parameter value changed to 3, FileA saved.
- When initiating backtest, parameter value 3 used.

Parameter value changed to 6, FileA saved.
- When initiating backtest, parameter value 3 used.


I can only overcome this by renaming the file every time I change anything.

Has any of you ran into a similar issue? What do I need to do to ensure that the latest saved file gets loaded to backtester? I'd be really grateful for suggestions to solve it!

I'm using MetaTrader5 on Mac. To my knowledge, I haven't changed anything in the settings!

Thanks,

B

 

What "saved files" are you talking about? Is the Strategy Tester in MetaTrader 5?

Those don't seem to be standard messages from the tester, but rather log output generated by your own code.

You will have to explain things in more detail if you want us to understand your issue.

 
Fernando Carreiro #:

What "saved files" are you talking about? Is the Strategy Tester in MetaTrader 5?

Those don't seem to be standard messages from the tester, but rather log output generated by your own code.

You will have to explain things in more detail if you want us to understand your issue.

Hi there,

Thanks for your prompt reply!

Yes, I'm using strategy tester "Expert advisor single test" in MetaTrader 5.

I'm loading my own code as the "Expert". In attached screen shot, the file "MyAlgo_2_KS_Mod6" corresponds to the FileA in the example above. I have the file open in MetaEditor in parallel and I'm updating the code and saving it after each back test. I'd like the Strategy Tester to always use the latest saved file to run the new test.

Files:
Untitled.jpg  115 kb
 
BetsiS #: Hi there, Thanks for your prompt reply! Yes, I'm using strategy tester "Expert advisor single test" in MetaTrader 5. I'm loading my own code as the "Expert". In attached screen shot, the file "MyAlgo_2_KS_Mod6" corresponds to the FileA in the example above. I have the file open in MetaEditor in parallel and I'm updating the code and saving it after each back test. I'd like the Strategy Tester to always use the latest saved file to run the new test.

That happens sometimes when you have multiple installations and you open up more than one at the same time. It also happens when the file dates are not updated properly.

Do do the following:

  1. Close MetaEditor.
  2. Close Metatrader.
  3. Delete the ".ex?" files with the problem.
  4. Start MetaTrader again
  5. click on the "IDE" button to start MetaEditor from within MetaTrader.
  6. Open the source files (of the affected *.ex? files), make a small change and re-save (to update file dates).
  7. Recompile all the files that were deleted in step 3.

After that, things should be in sync again and should work as it did before.

EDIT: You keep saying "saved", but please note that there is a difference between "save" and "compile".

 
Fernando Carreiro #:

That happens sometimes when you have multiple installations and you open up more than one at the same time. It also happens when the file dates are not updated properly.

Do do the following:

  1. Close MetaEditor.
  2. Close Metatrader.
  3. Delete the ".ex?" files with the problem.
  4. Start MetaTrader again
  5. click on the "IDE" button to start MetaEditor from within MetaTrader.
  6. Open the source files (of the affected *.ex? files), make a small change and re-save (to update file dates).
  7. Recompile all the files that were deleted in step 3.

After that, things should be in sync again and should work as it did before.

EDIT: You keep saying "saved", but please note that there is a difference between "save" and "compile".

Thanks Fernando for the explanation and pointing out these details! I tried these steps and a couple more but unfortunately nothing helped. I finally uninstalled the program and all the related files and re-installed it but the issue persists.

I'm quite a beginner so I guess I'll 1) Review my mql5 course and 2) maybe buy a PC with a hope mt5 works better there :D

Any other suggestions in the meantime are also welcome.

Cheers,

B