Hello Dmitrii I've tried your example and from what I see it won't work if the calling of the SingletonOperation() is made in a EA and the reading of the value (GetSingletonData()) is happening in the Indicator that had been created by the EA.
I've tried the code and when the two main functions:SingletonOperation(); //(we have to modify it to able to accept one string argument here)
called from an EA and the other:
GetSingletonData()
is called from the underlying indicators, loaded by the EA - it doestn't seem to be working....
Why is that?
Is Singleton Pattern even possible in MT5 in the context of EA and Indicators?

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Singleton - creational design pattern:
Ensure one instance of a class with a global point of access
Author: DMITRII PECHERITSA