Libraries: Singleton - creational design pattern

 

Singleton - creational design pattern:

Ensure one instance of a class with a global point of access

Author: DMITRII PECHERITSA

 

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?