Dear Slawa,
Right, that was the result of my observations and tests.
The current implementation prevents from writing real libraries, because I must call the libraries from the main EA, and can't use calls from one library to another (in the same context of the main EA of course).
Imagine a set of libraries that MetaTrader users will write and publish. We will get a huge library data base
that will cause more and more investors move to MetaTrader, This is MetaTrader main interest.
For me, as a programmer, it is a design issue, it will help to write more and more libraries with very specific responsibilities(e.g. money managemnet strategies library, trailing stops strategies library etc.), to separate code to different modules, so EAs will become more readable and more easy to modify and enhance.
I really hope you can change the implementation real soon. I'm working on a trading Framework based on MQ4 and it will be much more effective if all modules will run in the same memory block (one instance in memory) like it is in every programming language.
One more thing: If you can publish object oriented language MQ++ language that would be great :)
Thanks a lot,
Keep on doing great job,
Ruby
there are 2 copies of the B libraries: from EA and from A
You can check it with GetBFromA (like SetBFromA)
As designed
You can check it with GetBFromA (like SetBFromA)
As designed
Right, that was the result of my observations and tests.
We'll think
The current implementation prevents from writing real libraries, because I must call the libraries from the main EA, and can't use calls from one library to another (in the same context of the main EA of course).
Imagine a set of libraries that MetaTrader users will write and publish. We will get a huge library data base
that will cause more and more investors move to MetaTrader, This is MetaTrader main interest.
For me, as a programmer, it is a design issue, it will help to write more and more libraries with very specific responsibilities(e.g. money managemnet strategies library, trailing stops strategies library etc.), to separate code to different modules, so EAs will become more readable and more easy to modify and enhance.
I really hope you can change the implementation real soon. I'm working on a trading Framework based on MQ4 and it will be much more effective if all modules will run in the same memory block (one instance in memory) like it is in every programming language.
One more thing: If you can publish object oriented language MQ++ language that would be great :)
Thanks a lot,
Keep on doing great job,
Ruby
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
5 files.
Put them in the experts directory
Compile A.mq4
Compile B.mq4
Compile EA.mq4
Put EA.mq4 on a chart
Watch the "Experts" Tab
Search these 2 lines in the "Experts" tab:
ScenarioA: 1
ScenarioB: 0 !!!!!!
Error in scenario B:
Lib B has a variable named b
When the EA Calls Lib B function SetB, and then get it back by calling Lib B function GetB
we receive the right value.
But when the EA Calls Lib A function SetBFromA , and then try to get it back by calling Lib B function GetB we receive the wrong value.
This is because b seems to "live" in two separated memory blocks: if we will print GetB inside SetBFromA we will probably get the value of 1.
Are you aware of this bug?
Thanks
Ruby
B.mqh
B.mq4
A.mqh
A.mq4
EA.mq4