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
Hello everyone,
I’ve noticed that in the standard MQL5 library ( Expert.mqh ), the CExpert class (derived from CExpertBase ) implements its own Init() method without calling the parent class’s CExpertBase::Init() .
This seems unusual because:
Inheritance Principle: Child classes typically call parent initialization to ensure proper setup.
Potential Risks: Skipping CExpertBase::Init() might miss critical base configurations.
Questions:
Is this intentional design (e.g., performance optimization)?
Could it lead to undefined behavior if CExpertBase::Init() contains essential logic?
How should we handle initialization in custom expert advisors derived from CExpert ?
Looking forward to your insights!