Download Multicurrency On Tick (string symbol) event handler for MetaTrader 5

Multicurrency On Tick (string symbol) event handler

Multicurrency On Tick (string symbol) event handler

This software component for MetaTrader 5 is built to enhance the capabilities of your trading environment. This Expert Advisor serves as automated trading software. It is utilized to monitor financial markets and execute trades based on predefined algorithmic rules, enabling precise position management without the need for constant manual oversight.

MT5 expert Pack 📂

How to Setup and Use Multicurrency On Tick (string symbol) event handler

1. Installation: Open the "File" menu, select "Open Data Folder," navigate to MQL/Experts, paste your file, and restart the terminal.

2. Activation: Drag the EA from the Navigator onto a chart, ensure "Allow live trading" is checked in the Common tab, and verify the AutoTrading button is green.

3. Optimization: Right-click your chart, choose "Expert List," click "Properties" to adjust inputs, and save your preferred setup as a set file for future use.

4. Maintenance: Regularly check the "Experts" tab in the terminal window to monitor trade logs and potential execution errors.

Frequently Asked Questions

Q: Why is my EA not opening trades? A: Check the "AutoTrading" button, ensure "Allow live trading" is enabled, and verify your broker allows automated trading on your account type.

Q: Can I run multiple EAs on one chart? A: No, each chart can only host one active EA; however, you can open multiple charts for different currency pairs to run several EAs.

Q: What does the "smiley face" icon mean? A: A smiley face in the top-right corner of the chart indicates the EA is successfully running; a frowny face means it is disabled.

Description & Settings


This is the new implementation of full-featured multi-currency mode in MetaTrader 5. It's implemented in extended OnTick(string symbol) function.
Benefits:

It provides the real multi-currency mode on demo and real accounts.

It has simple settings.

The events list for OnTick(string symbol): can be configured: NewTick and/or NewBar.

The list of symbols can be configured (all symbols from Market Watch or some specified symbols).

When working with Market Watch symbols, it allows to manage the events "on the fly" in OnTick(string symbol).

It isn't necessary to understand the details of its work. All code is contained in the include file.

It can be used in Strategy Tester.
The Expert Advisor template looks as follows:
Some features:
1. Settings
All settings can be configured using the #define directives. For correct work of the OnTick(string symbol) function you need to specify only two parameters: SYMBOLS_TRADING and CHART_EVENT_SYMBOL.The first (SYMBOLS_TRADING) defines the symbol list, used for the events. The second (CHART_EVENT_SYMBOL) defines the event types for all symbols.
The SYMBOLS_TRADING contains the list of symbols, for example:
The list must be prepared as strings, separated by comma. The list ends with end of the line.
The SYMBOLS_TRADING can be defined as follows:
This way means that all symbols from Market Watch will be used. This method can be used to change the list of symbols "on the fly". Just add or remove to Market Watch the symbols needed.
The CHART_EVENT_SYMBOL event type is defined by flag or their combination from the ENUM_CHART_EVENT_SYMBOL enumeration. See details (in Russian).
Here are examples of the event types:
2. Include file.
The #include OnTick(string symbol).mqh is needed, this file contain the implementation of OnTick(string symbol) function. It provides the simple way to use all the OnTick(string symbol) function. Some of the standard functions should be declared in code of Expert Advisor, even if they are empty.
3. Strategy Tester.
As you know (at present time), the OnChartEvent doesn't supported in Strategy Tester. To solve this problem, the global variables are used to handle the events. This way is used in Strategy Tester only, in all other cases (on real/demo accounts) the events processed via the OnChartEvent.
Here is the feature. In Strategy Tester the OnTick(string symbol) will work on the ticks of the symbol, specified in the settings of Strategy Tester. In other words, it works like OnTick(), but called also when new ticks on the selected symbols. For working with Strategy Tester the SYMBOLS_TRADING must be specified as a list of symbols.
4. "Spies".
It uses the "spies" (agents-indicators). The "Spy Control panel MCM.ex5" file must be located in \MQL5\Indicators\ folder.
5. The files from the archive must be extracted into the \MQL5 folder. The files needed:

/MQL5/Experts/OnTick(string symbol).mq5 - Example of Expert Advisor, source code of the template;

/MQL5/Experts/OnTick(string symbol).ex5 - Example of Expert Advisor compiled file;

/MQL5/Indicators/Spy Control panel MCM.mq5 - Agent-indicator, source code;

/MQL5/Indicators/Spy Control panel MCM.ex5 - Agent-indicator, compiled file;

/MQL5/Include/OnTick(string symbol).mqh - include file with all functions needed for implementation of OnTick(string symbol) function.

You May Also Like

RobotFX does not own any of the code provided on this platform. All tools are freely available on the internet; we simply index and re-offer them for download. We are not responsible for any financial losses that may occur. Trading responsibilities rely solely on the traders downloading and using the displayed Expert Advisors, indicators, and scripts. These tools are provided for educational purposes only and may require modification or optimization to align with a trader's specific strategy or needs.
© ROBOTFX - Best MetaTrader Expert Advisors & Indicators