Weird behavior when running Metatrader 5 backtest in Windows Container

Hello all, I’m using Docker Engine 27.4.0. Running in Windows Container mode on a Windows 10 pro machine. Using mcr microsoft com/windows/servercore:20H2

I have decided to build a custom image where a NodeJS express app listens for POST requests coming from the network. One of my routes consists of starting a Metatrader5 backtest (simulation on financial markets) and sends back the result as an html report. This works perfectly on first run, but for some reason, all subsequent calls fails to create the resulting html report. To me it seems specific to Metatrader5, but the logs do not suggest that anything failed, and they are pretty big on logging.

The only way I found this fix this is to force a restart of the container after it ran the backtest, this obviously fixes the issue as it returns to its original state, but feels quite inefficient since I will loose all financial data caching.

I’m wondering if there’s something I’m missing, why would Metatrader 5 fail to write its html report on subsequent runs ? I have tried overwriting existing report files, I also tried using incrementing report names to have unique file name per backtest.

Thanks for any ideas or suggestions!

Well, then you should ask at a metatrader forum, not at a Docker forum :wink:

Do they support running it in Docker containers? If you built yur own image, how did you do that? Are you sure the process is running properly and doesn’t fail right after the first request and response?

We can help with the Docker part, but you will need to help us with Metatrader knowledge. Not everything can run in a container properly without modification. You can also try to find existing images on Docker Hub or on GitHub and learn from those, how it should be done properly.

Yes good idea, thanks for suggesting this approach!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.