Why CExpert.Init does not call CExpertBase.Init?

 

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:

  1. Inheritance Principle: Child classes typically call parent initialization to ensure proper setup.

  2. 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!