Expert Advisors: Multicurrency OnTick (string symbol) event handler

 

Multicurrency OnTick (string symbol) event handler:

This is the simplified implementation of multicurrency mode in MetaTrader 5. It isn't necessary to consider the details how does it work. It has minimum settings and simple structure.

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.

Author: Константин

 
Thanks to the author! Great article for users! Thoughtful, simple and easy to use interface-template.
 

The article is really excellent, especially in the absence of standard and more elegant solutions in the language itself.

I wish they would sort out the events in the tester sooner. Kudos to the author for his work.

 
-Alexey-:
Thanks to the author! Great article for users! Thoughtful, simple and easy to use interface-template.
Interesting:

The article is really great, especially in the absence of standard and more elegant solutions in the language itself.

I wish they'd sort out the events in the tester already. Kudos to the author for his work.

Thank you, colleagues.

If anyone has used it, please share your observations or ideas.

 

Excellent option of the multicurrency mode. Everything is clear and understandable. And it seems to work as it should.

 
While there is no possibility to study the template code, it is easier to ask: is the multithreading mode implemented (each symbol has its own thread), or is everything running within one thread?
 
Yedelkin:
While there is no opportunity to study the template code, it is easier to ask: is the multithreading mode implemented (each symbol has its own thread), or is everything running within one thread?
No, it is not implemented. There is one exception: all loaded"spies" for symbols will work in their own threads.
 
Lizar:
No, it is not implemented. There is one exception: all loaded"spies" for characters will run in their own threads.
OK! And it was already clear about spies even after reading the article :)
 

Hallo, Lizar

i'm  new to mql5 so i'm in trouble trying to understand the code.. I have a couple of question:

  1. i don't understand how you track the event generated by the spy control panel in the tester phase using global variables
  2. why the exadecimal numeration of ENUM_CHART_EVENT_SYMBOL  and if i can change it in "int" from 1 to 23
  3. there may be some problems with handling the indicators becouse if you change timeframe the agents duplicates: it seems there isn't indicator handles cancellation..

I'm trying to build something like    https://www.mql5.com/en/articles/143 but in multicurrency mode..

I'm designing the structure of EA and your implementations of CisnewBar and this for multimulticurrency mode using custom events are very interesting and usefull

for my pourpose.. the last question (for a moment! :) ) why you can't implement something like  CisnewBar for multimulticurrency mode? I read your great article https://www.mql5.com/en/articles/234 but there isn't an example EA that trade on varius instruments, only an indicator, so for me it's a little harder to understand the whole topic..

thank you in advance, and sorry for my english, i'm italian.. 

 

Lizar, dear, help me to finalise your last multival from February.

I did everything as you wrote, but while (since 2-00 today) opened and modified one instument?

 
artall:

Lizar, dear, help me to finalise your last multival from February.

I did everything as you wrote, but while (since 2-00 today) opened and modified one instument?


Now checked what is here in the archive. Everything works. Do you get ticks on all instruments? They may not come in two cases: if there is no instrument in the "Market Watch" or the spy has not started.