Inheritance

samjesse

Active Trader
Aug 30, 2011
118
0
27
Hi

I am getting compile time error when compiling REGCH.mqh, I can not understand why. please help.

thx


'STOCH_POPULT' - wrong parameters count REGCH.mqh 31 4

MQL5:
class REGCH : public STOCH_POPULT

constructors:
MQL5:
   REGCH(string sym, ENUM_TIMEFRAMES prd){first_run=true;}

and

MQL5:
STOCH_POPULT::STOCH_POPULT(string sym, ENUM_TIMEFRAMES prd)
{
 
Last edited by a moderator:

samjesse

Active Trader
Aug 30, 2011
118
0
27
MQL5:
//+------------------------------------------------------------------+
//|                                                  myUtilities.mqh |
//+------------------------------------------------------------------+
 
 
class STOCH_POPULT
{
protected:
   string _symbol;
   ENUM_TIMEFRAMES _period;
   ushort bars; 
   bool first_run;
   double low[300];
 
public:
   STOCH_POPULT(string sym, ENUM_TIMEFRAMES prd)
   {
      bars = ArraySize(low);
   };
 
   ~STOCH_POPULT(){};
 
 
};

MQL5:
//+------------------------------------------------------------------+
//|                                                        REGCH.mqh |
//+------------------------------------------------------------------+
#include <myUtilities.mqh>
class REGCH : public STOCH_POPULT
  {
private:    //-----------------------------------------
 
public:     //-----------------------------------------
   REGCH(string sym, ENUM_TIMEFRAMES prd)
   {
      _symbol = sym;
      _period = prd;   
      first_run=true;
   }
   ~REGCH();
 
 
  };
REGCH::~REGCH() { }
 
Last edited by a moderator: