Memory Mapping
Info
The Memory Mapping is a Library for MetaTrader 5 that this project (visual c++ 2010) contains 2 classes - cmemmapapi и cmemmapfile. They designed for working with memory mapped files.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Library works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Libraries folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Memory Mapping
1. Storage: Place library files in the MQL/Libraries directory to ensure they are accessible to your projects.
2. Implementation: Include the library in your code using the #import directive, ensuring you match the exact function names and parameters.
3. Compilation: Ensure the library is present in the directory before you compile your main EA or script, as the compiler links them during this phase.
4. Management: Keep libraries organized in sub-folders if you manage many custom functions to maintain a clean project structure.
Frequently Asked Questions
Q: What is a library file used for? A: Libraries store reusable code modules, allowing you to centralize common logic used by multiple EAs or indicators.
Q: Is a library executable? A: No, libraries are non-executable files containing functions; they must be imported into an EA, indicator, or script to function.
Q: Can I update a library while the platform is running? A: You should compile your EA or script after updating a library to ensure the latest code changes are integrated.
What this tool does
This project (Visual C++ 2010) contains 2 classes - CMemMapApi и CMemMapFile.
Typical Use Case
This Library excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Library works on MetaTrader 5. Place the file in the MQL5/Libraries folder and restart the terminal.
Description & Settings
Related: Memory - another powerful library for MetaTrader 5 traders.
This project (Visual C++ 2010) contains 2 classes - CMemMapApi и CMemMapFile.
They designed for working with memory mapped files. You can:
Create file in memory;
Also recommended: File Mapping without DL L - similar library with strong performance on MetaTrader 5.
Write and read data from memory mapped file;
It provides an opportunity to exchange data between applications, including MetaTrader 4 и МetaТrader 5.Using memory mapped files you can achieve a great performance in data exchange. The main application is the data exchange:
Copying of the trades for several terminals on one PC
Quotes data exchange for the arbitrage Expert Advisors etc.
The memory mapped files can be used for a serve of the temporary data of the Expert Advisors.The CMemMapApi class is just a wrapper of WinApi functions, that's the difference between CMemMapFile and CMemMapApi.
The CMemMapFile is useful, because it serves file name, file handle and controls the checkings of file size. In contrast, CMemMapApi class can work with several memory mapped files.
In current project the exported DLL functions are organized in CMemMapApi for working with several memory-mapped files.The CMemMapFile class is designed for working with memory mapped files in other C++ projects.
Exported functions:
Example of the DLL use:
12.03. 2012: Fixed an error in Mem
WriteStr
You may also like: Reporting Memory Leaks in Strategy Tester - excellent alternative for library users on MetaTrader 5.
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.