What am I doing wrong? Standard include errors

 

Hello,

Since April 2011 I opened 5 ticket on the service desk.

None of them did receive any kind of response. I am not talking about solution, just answer.

Should I also post somewhere to have those tickets read?

 

The last one is about new release. Each time MQ release a new version, it comes with some mqh in include folder. 3 of them did not compile because of an issue I report in the last ticket :

 

Is there anyone having the same issue, is there something I am doing wrong?

 

Regards, 

Compilation errors after each new release
Errors, MetaTrader 4 / MQL4, Open, Start: 2014.07.11 17:00, #1038907

In include files following code raise compilation errors : 

Indicators.mqh :

Compilation error : Macro redefinition

Solution comment following lines :

 

//#define    OBJ_NO_PERIODS 0
//#define    OBJ_PERIOD_M1  0x00000001
#define    OBJ_PERIOD_M2  0x00000002
#define    OBJ_PERIOD_M3  0x00000004
#define    OBJ_PERIOD_M4  0x00000008
//#define    OBJ_PERIOD_M5  0x00000010
#define    OBJ_PERIOD_M6  0x00000020
#define    OBJ_PERIOD_M10 0x00000040
#define    OBJ_PERIOD_M12 0x00000080
//#define    OBJ_PERIOD_M15 0x00000100
#define    OBJ_PERIOD_M20 0x00000200
//#define    OBJ_PERIOD_M30 0x00000400
//#define    OBJ_PERIOD_H1  0x00000800
#define    OBJ_PERIOD_H2  0x00001000
#define    OBJ_PERIOD_H3  0x00002000
//#define    OBJ_PERIOD_H4  0x00004000
#define    OBJ_PERIOD_H6  0x00008000
#define    OBJ_PERIOD_H8  0x00010000
#define    OBJ_PERIOD_H12 0x00020000
//#define    OBJ_PERIOD_D1  0x00040000
//#define    OBJ_PERIOD_W1  0x00080000
//#define    OBJ_PERIOD_MN1 0x00100000
//#define    OBJ_ALL_PERIODS 0x001fffff

  

oscilators.mqh:

Compilation error : improper enumerator cannot be used 

iForce is declared in mql4 with applied_price instead of applied_volume. need to update the code as following : 

Same issue for iOBV class in Volumes.mqh  

 

//+------------------------------------------------------------------+
//| Class CiForce.                                                   |
//| Purpose: Class of the "Force Index" indicator.                   |
//|          Derives from class CIndicator.                          |
//+------------------------------------------------------------------+
class CiForce : public CIndicator
  {
protected:
   int               m_ma_period;
   ENUM_MA_METHOD    m_ma_method;
   //ENUM_APPLIED_VOLUME m_applied;
   ENUM_APPLIED_PRICE m_applied;

public:
                     CiForce(void);
                    ~CiForce(void);
   //--- methods of access to protected data
   int               MaPeriod(void)        const { return(m_ma_period); }
   ENUM_MA_METHOD    MaMethod(void)        const { return(m_ma_method); }
   ENUM_APPLIED_PRICE Applied(void)        const { return(m_applied);   }
   //--- method of creation
   bool              Create(const string symbol,const ENUM_TIMEFRAMES period,
                            const int ma_period,const ENUM_MA_METHOD ma_method,const ENUM_APPLIED_PRICE applied);
   //--- methods of access to indicator data
   virtual double    GetData(const int buffer_num,const int index) const;
   double            Main(const int index) const;
   //--- method of identifying
   virtual int       Type(void) const { return(IND_FORCE); }

protected:
   //--- methods of tuning
   virtual bool      Initialize(const string symbol,const ENUM_TIMEFRAMES period,const int num_params,const MqlParam &params[]);
   bool              Initialize(const string symbol,const ENUM_TIMEFRAMES period,
                                const int ma_period,const ENUM_MA_METHOD ma_method,const ENUM_APPLIED_PRICE applied);
  };
//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
CiForce::CiForce(void) : m_ma_period(-1),
                         m_ma_method(-1),
                         m_applied(-1)
  {
  }
//+------------------------------------------------------------------+
//| Destructor                                                       |
//+------------------------------------------------------------------+
CiForce::~CiForce(void)
  {
  }
//+------------------------------------------------------------------+
//| Create indicator "Force Index"                                   |
//+------------------------------------------------------------------+
bool CiForce::Create(const string symbol,const ENUM_TIMEFRAMES period,
                     const int ma_period,const ENUM_MA_METHOD ma_method,const ENUM_APPLIED_PRICE applied)
  {
   SetSymbolPeriod(symbol,period);
//--- result of initialization
   return(Initialize(symbol,period,ma_period,ma_method,applied));
  }
//+------------------------------------------------------------------+
//| Initialize the indicator with universal parameters               |
//+------------------------------------------------------------------+
bool CiForce::Initialize(const string symbol,const ENUM_TIMEFRAMES period,const int num_params,const MqlParam &params[])
  {
   return(Initialize(symbol,period,(int)params[0].integer_value,(ENUM_MA_METHOD)params[1].integer_value,
          (ENUM_APPLIED_PRICE)params[2].integer_value));
  }
//+------------------------------------------------------------------+
//| Initialize the indicator with special parameters                 |
//+------------------------------------------------------------------+
bool CiForce::Initialize(const string symbol,const ENUM_TIMEFRAMES period,
                         const int ma_period,const ENUM_MA_METHOD ma_method,const ENUM_APPLIED_PRICE applied)
  {
   m_name="Force";
//--- save settings
   m_ma_period=ma_period;
   m_ma_method=ma_method;
   m_applied  =applied;
//--- ok
   return(true);
  }
//+------------------------------------------------------------------+
//| Access to buffer of "Force Index"                                |
//+------------------------------------------------------------------+
double CiForce::GetData(const int buffer_num,const int index) const
  {
   return(iForce(m_symbol,m_period,m_ma_period,m_ma_method,m_applied,index));
  }
//+------------------------------------------------------------------+
//| Access to buffer of "Force Index"                                |
//+------------------------------------------------------------------+
double CiForce::Main(const int index) const
  {
   return(GetData(0,index)); 

  } 

 
och:

Hello,

Since April 2011 I opened 5 ticket on the service desk.

None of them did receive any kind of response. I am not talking about solution, just answer.

Should I also post somewhere to have those tickets read?

 

The last one is about new release. Each time MQ release a new version, it comes with some mqh in include folder. 3 of them did not compile because of an issue I report in the last ticket :

 

Is there anyone having the same issue, is there something I am doing wrong?

 

Regards, 

Compilation errors after each new release
Errors, MetaTrader 4 / MQL4, Open, Start: 2014.07.11 17:00, #1038907

In include files following code raise compilation errors : 

Indicators.mqh :

Compilation error : Macro redefinition

Solution comment following lines :

 

  

oscilators.mqh:

Compilation error : improper enumerator cannot be used 

iForce is declared in mql4 with applied_price instead of applied_volume. need to update the code as following : 

Same issue for iOBV class in Volumes.mqh  

 

  } 

They do not reply recently to messages.

The easiest solution is - when you like some code from their library - copy it to some personal folder, and fix it by yourself. Fixing it in original location is waste of time, as they get replaced with every new release. Posting messages to service desk is also waste of time, as the priority of such code fix would be low.

I tried to delete all those "standard" libraries, but they keep reappearing with every new update, like influenza.

 
och:

Is there anyone having the same issue, is there something I am doing wrong?

Indicators.mqh :

Compilation error : Macro redefinition

Please, provide more info on the context where you receive such errors - they may be related to some code in your project.
 
marketeer:
Please, provide more info on the context where you receive such errors - they may be related to some code in your project.
There are warnings you receive when you compile indicated files.
Reason: