I have some questions regarding the use of DLLs during multi-threaded backtesting in MetaTrader 5, based on the documentation I found:
Multiple Instances: From the documentation, it seems that if a DLL is already loaded (even by another Expert Advisor or client terminal), it will be shared rather than creating multiple instances. Can someone confirm if this understanding is correct? How does this affect thread safety, especially when the same DLL functions are called from multiple threads?
Synchronization: Since DLL functions are executed in the thread of the calling module, and synchronization is not managed by the MetaTrader backtesting engine, what are the best practices for handling synchronization within the DLL? Specifically, how can I ensure that shared resources are accessed safely and efficiently in a multi-threaded environment?
Any insights, experiences, or best practices on managing DLL usage and ensuring thread safety during backtesting would be greatly appreciated.
The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC", "Every tick" and "Every tick based on real ticks" using actual historical data.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello MQL5 Community,
I have some questions regarding the use of DLLs during multi-threaded backtesting in MetaTrader 5, based on the documentation I found:
Multiple Instances: From the documentation, it seems that if a DLL is already loaded (even by another Expert Advisor or client terminal), it will be shared rather than creating multiple instances. Can someone confirm if this understanding is correct? How does this affect thread safety, especially when the same DLL functions are called from multiple threads?
Synchronization: Since DLL functions are executed in the thread of the calling module, and synchronization is not managed by the MetaTrader backtesting engine, what are the best practices for handling synchronization within the DLL? Specifically, how can I ensure that shared resources are accessed safely and efficiently in a multi-threaded environment?
Any insights, experiences, or best practices on managing DLL usage and ensuring thread safety during backtesting would be greatly appreciated.
Thank you!
Best regards,
Ramzi