Developing a multi-currency Expert Advisor — source codes from a series of articles
Info
The Developing a multi-currency Expert Advisor — source codes from a series of articles is a Library for MetaTrader 5 that this series of articles is in the process of being written. As we move forward, source codes from new articles will be added to this library.
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 Developing a multi-currency Expert Advisor — source codes from a series of articles
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 series of articles is in the process of being written.
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: Fuzzy - library for developing fuzzy models - another powerful library for MetaTrader 5 traders.
This series of articles is in the process of being written. As we move forward, source codes from new articles will be added to this library.
Also recommended: Developing Multicurrency Expert Advisor - source codes from the article series - similar library with strong performance on MetaTrader 5.
It is recommended to review the code in the order of publication of articles in order to better monitor the development and changes made.At this stage, the general scheme of the library looks like this:
An example of the test results for Expert Advisor from the article (Part 3):
A list of published articles with a detailed explanation of the development process:
There are quite a few different trading strategies. From the point of view of risk diversification and increasing the sustainability of trading results, it may be useful to use several parallel strategies. But if each strategy is implemented as a separate adviser, then it becomes much more difficult to manage their joint work on one trading account. To solve this problem, it is advisable to implement the work of different trading strategies in one Expert Advisor.
We will continue to develop a multi-currency advisor with several parallel strategies. Let's try to transfer all the work related to opening market positions from the strategy level to the level of an expert managing strategies. The strategies themselves will only trade virtually, without opening market positions.
We have already made some progress in developing a multi-currency advisor with several parallel strategies. Taking into account the accumulated experience, we will review the architecture of our solution and try to improve it before we go too far ahead.
Having started developing a multi-currency advisor, we have already achieved some results and managed to carry out several iterations of code improvement. However, our advisor could not work with pending orders and resume work after restarting the terminal. Let's add these features.
The full code is located in the attached archive due to the large number of files. Unzip it into the Experts folder. The files inside are divided into folders related to individual articles. Code from all parts added in archive, but at present only Part 1 and Part 2 have translated comments.
The two visible source code files are not used, they are only needed for publication.
You may also like: Calendar-Based Backtesting: an Event-Driven Trading EA - 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.