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
Sure, it is quite common, in fact Java has it as the mandatory rule for public classes. Though the circular dependencies in your example are not a good example of a public class.
1) Well my two classes depend on each other and
2) real problems differ unfortunately from these wonderful and brilliant examples in the explanatory documentations.
1) Well my two classes depend on each other and
2) real problems differ unfortunately from these wonderful and brilliant examples in the explanatory documentations.
Well it's pretty easy what I want: At initialisation Class 1 CI 'acts' on Class 2 CQ but in OnStart() Class 2 CQ 'acts' on Class 1 CI.
This is the relation: For each CI exists for sure one CQ, but CQ can has 1 or more CI.
Therefore:
Also please provide more info about exact errors you get. I compile your multiple files without an issue.
Attached are four files. The file with the base class(es) CI and CQ: TestCQI.mqh This file compiles correctly!
Now I want to create a couple of derived classes of CI TestDerv1CI, TestDerv2CI, TestDerv3CI, TestDerv4CI, but I would like be able to to store their individual reference in one array of references:
This is the way I finally would like to able to handle them. Alternatively but not that convenient I can do as well:
For both ways I think I would need a constructor for the derived classes - and that causes the compiler to complain. I tried to use the GekkoEA example:
I tried to copy that in my derived class:
And this makes my compiler cry:
Ok, this seems to to work, now I am trying to use the shape example from the editor's reference (search for Virtual Functions):
Wow, this compiles correctly !!!
Now I write a little script - and am stuck again, compiler errors :(
What do I have to do that I can write in my script:
Thanks for your patience and effort!!
Calli
Here is a couple of your fixed files.
Yet it's still not clear what you want to achieve. This is very very strange to pass a reference of an external array to another constructor in order to create other class instance and add into this array, which is not related to the class which object is being constructed.
Tank you very much!
Sorry for bothering I haven't been precise enough :(