EA expert wizard can't recognize my custom module of trade signas

 

I can't understand why tutorial about custom module of trade signals works and can be found in the wizard, but my module can't.

This is my custom module of trade signals.

Include\Expert\MySignals\KeltnerChannelSignal.mqh

//+------------------------------------------------------------------+
//|                                         SignalKeltnerChannel.mqh |
//|                                  Copyright 2019, Marco Consiglio |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Marco Consiglio"
#property link      "https://www.mql5.com"
#property version   "1.00"

//+------------------------------------------------------------------+
//| Constants                                                        |
//+------------------------------------------------------------------+
#define KeltnerChannelFile "Indicators\\Keltner Channel\\keltner_channel.ex5"
#property tester_indicator KeltnerChannelFile
//+------------------------------------------------------------------+
//| Included files                                                   |
//+------------------------------------------------------------------+
#include <Expert\ExpertSignal.mqh>
#include <Indicators\Keltner Channel\enum.mqh>
#include <Indicators\Keltner Channel\GetIndicatorBuffers.mqh>
#include <Crosses.mqh>
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=KeltnerChannelSignal                                       |
//| Type=SignalAdvanced                                              |
//| Name=KeltnerChannel                                              |
//| Class=CKeltnerChannelSignal                                      |
//| Page=                                                            |
//| Parameter=Timeframe,int,12,PERIOD_CURRENT,Timeframe              |
//| Parameter=MAPeriod,int,20,MA period                              |
//| Parameter=MAMethod,enMaModes,ma_Simple,MA smoothing method       |
//| Parameter=MAVisible,enMaVisble,mv_Visible, MA visible?           |
//| Parameter=PriceType,enPrices,pr_typical,Price type               |
//| Parameter=ColorSlopeUp,color,clrGold,Color for slope up          |
//| Parameter=ColorSlopeDown,color,clrGold,Color for slope down      |
//| Parameter=ATRPeriod,int,20                                       |
//| Parameter=ATRMultiplier,double,2.0                               |
//| Parameter=ATRMode,enAtrMode,atr_Rng                              |
//| Parameter=ViewBars,enCandleMode,cm_None                          |
//| Parameter=Interpolate,bool,true                                  |
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
//| The CKeltnerChannelSignal class.                                 |
//| Purpose: Class of trading signal generator                       |
//|          It is derived from the CExpertSignal class.             |
//+------------------------------------------------------------------+
class CKeltnerChannelSignal : public CExpertSignal
{
   protected:
      //--- Indicators
      CiCustom          KeltnerChannel;
      
      //--- Setup parameters
      ENUM_TIMEFRAMES   m_timeframe;         //1  Time frame
      int               m_ma_period;         //2  Moving average period
      enMaModes         m_ma_method;         //3  Moving average type
      enMaVisble        m_ma_visible;        //4  Midlle line visible?
      enPrices          m_price_type;        //5  Moving average price type
      color             m_color_slope_up;    //6  Color for slope up
      color             m_color_slope_down;  //7  Color for slope down
      int               m_atr_period;        //8  Range period
      double            m_atr_multiplier;    //9  Range multiplier
      enAtrMode         m_atr_mode;          //10 Range calculating mode
      enCandleMode      m_view_bars;         //11 View bars as:
      bool              m_interpolate;       //12 Interpolate mtf data
      
      //--- Method to initialize indicators
      void              PrepareParameters();
      MqlParam          KeltnerChannelParameters[];
      bool              InitKeltnerChannel(CIndicators* indicators);
      
      //--- Buffers to access indicators data
      double            UpperKCLine[];
      double            MiddleKCLine[];
      double            LowerKCLine[];
      
      //--- "weights" of market models (0-100)
      int               m_pattern_0;      
      int               m_pattern_1;  
      
   public:
      //--- Constructor
                        CKeltnerChannelSignal();
                        
      //--- methods of adjusting "weights" of market models
      void              Pattern_0(int value)                {m_pattern_0         = value;}
      void              Pattern_1(int value)                {m_pattern_1         = value;}
      
      //--- Methods to set the parameters
      void              Timeframe(ENUM_TIMEFRAMES value)    {m_timeframe         = value;}
      void              MAPeriod(int value)                 {m_ma_period         = value;}
      void              MAMethod(enMaModes value)           {m_ma_method         = value;}
      void              MAVisible(enMaVisble value)         {m_ma_visible        = value;}
      void              PriceType(enPrices value)           {m_price_type        = value;}
      void              ColorSlopeUp(color value)           {m_color_slope_up    = value;}
      void              ColorSlopeDown(color value)         {m_color_slope_down  = value;}
      void              ATRPeriod(int value)                {m_atr_period        = value;}   
      void              ATRMultiplier(double value)         {m_atr_multiplier    = value;}  
      void              ATRMode(enAtrMode value)            {m_atr_mode          = value;} 
      void              ViewBars(enCandleMode value)        {m_view_bars         = value;}   
      void              Interpolate(bool value)             {m_interpolate       = value;}
      
      //--- Method to initialize indicators
      virtual bool      InitIndicators(CIndicators* indicators);
      
      //--- Method of verification of settings
      virtual bool      ValidationSettings(void);
      
      //--- Methods for signal condition check
      virtual int       LongCondition(void); 
      virtual int       ShortCondition(void);
   
};
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
CKeltnerChannelSignal::CKeltnerChannelSignal()
{
   m_timeframe = PERIOD_CURRENT;
   m_ma_period = 20;
   m_ma_method = ma_Simple;
   m_ma_visible = mv_Visible;
   m_price_type = pr_typical;
   m_atr_period = 20;
   m_atr_multiplier = 2.0;
   m_atr_mode = atr_Rng;
   m_view_bars = cm_None;
   m_interpolate = true;
}
//+------------------------------------------------------------------+
//| Validation of the setup parameters.                              |
//| OUTPUT: true if the settings are correct, otherwise false.       |
//+------------------------------------------------------------------+
bool CKeltnerChannelSignal::ValidationSettings()
{
   //--- Validation of parameters
   if(m_ma_period <= 1)
   {
      printf(__FUNCTION__+": the MA period must be greater than 2.");
      return(false);
   }
   if(m_atr_period <= 1)
   {
      printf(__FUNCTION__+": the ATR period must be greater than 2.");
      return(false);
   } 
   //--- OK
   return(true);
}
  
//+------------------------------------------------------------------+
//| Initialization of indicators and timeseries.                     |
//| INPUT:  indicators - pointer to the object - collection of       |
//|                      indicators and timeseries.                  |
//| OUTPUT: true in case of success, otherwise false.                |
//+------------------------------------------------------------------+
bool CKeltnerChannelSignal::InitIndicators(CIndicators* indicators)
{
   //--- Validation of the pointer
   if(indicators==NULL) return(false);
   
   //--- Initialization of the KeltnerChannel
   if(!InitKeltnerChannel(indicators))
   { 
      printf(__FUNCTION__+": can't initialize Keltner Channel indicator.");
      return(false); 
   }
   
   //--- Successful completion
   return(true);
}
//+------------------------------------------------------------------+
//| Prepare the Keltner Channel parameters array                     |
//+------------------------------------------------------------------+
void CKeltnerChannelSignal::PrepareParameters()
{
   ArrayResize(KeltnerChannelParameters, 13);
   KeltnerChannelParameters[0].type = TYPE_STRING;
   KeltnerChannelParameters[0].string_value = KeltnerChannelFile;
   //1  Time frame
   KeltnerChannelParameters[1].type = TYPE_INT;
   KeltnerChannelParameters[1].integer_value = m_timeframe;
   
   //2  Moving average period
   KeltnerChannelParameters[2].type = TYPE_INT;
   KeltnerChannelParameters[2].integer_value = m_ma_period;
   
   //3  Moving average type
   KeltnerChannelParameters[3].type = TYPE_INT;
   KeltnerChannelParameters[3].integer_value = m_ma_method;
   
   //4  Midlle line visible?
   KeltnerChannelParameters[4].type = TYPE_INT;
   KeltnerChannelParameters[4].integer_value = m_ma_visible;
   
   //5  Moving average price type
   KeltnerChannelParameters[5].type = TYPE_INT;
   KeltnerChannelParameters[5].integer_value = m_price_type;
   
   //6  Color for slope up
   KeltnerChannelParameters[6].type = TYPE_INT;
   KeltnerChannelParameters[6].integer_value = m_color_slope_up;
   
   //7  Color for slope down 
   KeltnerChannelParameters[7].type = TYPE_INT;
   KeltnerChannelParameters[7].integer_value = m_color_slope_down;
   
   //8  Range period
   KeltnerChannelParameters[8].type = TYPE_INT;
   KeltnerChannelParameters[8].integer_value = m_atr_period;
   
   //9  Range multiplier
   KeltnerChannelParameters[9].type = TYPE_DOUBLE;
   KeltnerChannelParameters[9].double_value = m_atr_multiplier;
   
   //10 Range calculating mode
   KeltnerChannelParameters[10].type = TYPE_INT;
   KeltnerChannelParameters[10].integer_value = m_atr_mode;
   
   //11 View bars as:
   KeltnerChannelParameters[11].type = TYPE_INT;
   KeltnerChannelParameters[11].integer_value = m_atr_mode;
   
   //12 Interpolate mtf data
   KeltnerChannelParameters[12].type = TYPE_BOOL;
   KeltnerChannelParameters[12].integer_value = m_interpolate;
}

//+------------------------------------------------------------------+
//| Initialization of the Keltner Channel                            |
//| INPUT:  indicators - pointer to the object - collection of       |
//|                      indicators and timeseries.                  |
//| OUTPUT: true in case of success, otherwise false.                |
//+------------------------------------------------------------------+
bool CKeltnerChannelSignal::InitKeltnerChannel(CIndicators *indicators)
{
   PrepareParameters();
   if(!KeltnerChannel.Create(m_symbol.Name(), m_period, IND_CUSTOM, 13, KeltnerChannelParameters))
   {
      printf(__FUNCTION__+": can't initialize Keltner Channel indicator.");
      return(false);
   }
   return(true);
}

//+------------------------------------------------------------------+
//| "Voting" that the price will go up.                              |
//| OUTPUT: the long signal strenght between 0 and 100.              |
//+------------------------------------------------------------------+
int CKeltnerChannelSignal::LongCondition(void)
{
   int Signal = 0;
   int idx = StartIndex();
   GetKeltnerChannelBuffers(KeltnerChannel, 0, 2, UpperKCLine, MiddleKCLine, LowerKCLine);
   double OpenPrices[];
   OpenPrices[0] = iOpen(m_symbol.Name(), m_period, 0);
   OpenPrices[1] = iOpen(m_symbol.Name(), m_period, 1);
   if(IS_PATTERN_USAGE(0) && Crossover(LowerKCLine, OpenPrices))
      Signal = m_pattern_0;
   if(IS_PATTERN_USAGE(1) && Crossunder(UpperKCLine, OpenPrices))
      Signal = m_pattern_1;
   return(Signal);
}

//+------------------------------------------------------------------+
//| "Voting" that the price will go down.                            |
//| OUTPUT: the short signal strenght between 0 and 100.             |
//+------------------------------------------------------------------+
int CKeltnerChannelSignal::ShortCondition(void)
{
   int Signal = 0;
   int idx = StartIndex();
   GetKeltnerChannelBuffers(KeltnerChannel, 0, 2, UpperKCLine, MiddleKCLine, LowerKCLine);
   double OpenPrices[];
   OpenPrices[0] = iOpen(m_symbol.Name(), m_period, 0);
   OpenPrices[1] = iOpen(m_symbol.Name(), m_period, 1);
   if(IS_PATTERN_USAGE(0) && Crossunder(UpperKCLine, OpenPrices))
      Signal = m_pattern_0;
   if(IS_PATTERN_USAGE(1) && Crossover(LowerKCLine, OpenPrices))
      Signal = m_pattern_1;
   return(Signal);
}

That's the custom indicator. You can find the attached file.

Indicators\Keltner Channel\keltner_channel.mq5

I followed obsessively three tutorial on the argument, but can't understand what is wrong or missing.

Can someone help me to make the wizard recognize my module?

I'm using MetaEditor 5.00 build 2190 (18 Oct 2019).
If you need other files or info in order to reproduce the "error" (indeed no error message appear) I will surely give immediately.
Thanks in advanced for the pious guy who can help me understand what's wrong with my custom module.

Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners — MQL5.community is developing along with you. mql5 community not showing in my newly...
 
Very, very many compilation errors.
 
Vladimir Karputov:
Very, very many compilation errors.

This is because I missed to attached some included file. No compilation errors for me. I will attach the missed files as soon as I can.

Here there are all the files.
\Include\Expert\MySignals\KeltnerChannelSignal.mqh
\Include\Indicators\Keltner Channel\enum.mqh
\Include\Indicators\Keltner Channel\GetIndicatorBuffers.mqh
\Include\Crosses.mqh

 

In general, this: again a mess - you again did not show ALL the files.

Goodbye.

 
Marco Consiglio :

Here there are all the files.
\Include\Expert\MySignals\KeltnerChannelSignal.mqh
\Include\Indicators\Keltner Channel\enum.mqh
\Include\Indicators\Keltner Channel\GetIndicatorBuffers.mqh
\Include\Crosses.mqh

Look for an error in the signal module.

To simplify:

//+------------------------------------------------------------------+
//|                                         SignalKeltnerChannel.mqh |
//|                                  Copyright 2019, Marco Consiglio |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Marco Consiglio"
#property link      "https://www.mql5.com"
#property version   "1.00"
#include <Expert\ExpertSignal.mqh>
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=KeltnerChannelSignal                                       |
//| Type=SignalAdvanced                                              |
//| Name=KeltnerChannel                                              |
//| Class=CKeltnerChannelSignal                                      |
//| Page=                                                            |
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
//| The CKeltnerChannelSignal class.                                 |
//| Purpose: Class of trading signal generator                       |
//|          It is derived from the CExpertSignal class.             |
//+------------------------------------------------------------------+
class CKeltnerChannelSignal : public CExpertSignal
  {

  };

then the signal module is detected in the list.

 
You can apply ONLY MQL5 enum! Custom enum is FORBIDDEN!

Example:

//+------------------------------------------------------------------+
//|                                         SignalKeltnerChannel.mqh |
//|                                  Copyright 2019, Marco Consiglio |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, Marco Consiglio"
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Constants                                                        |
//+------------------------------------------------------------------+
#define KeltnerChannelFile "Indicators\\Keltner Channel\\keltner_channel.ex5"
#property tester_indicator KeltnerChannelFile
//+------------------------------------------------------------------+
//| Included files                                                   |
//+------------------------------------------------------------------+
#include <Expert\ExpertSignal.mqh>
#include <Indicators\Keltner Channel\enum.mqh>
#include <Indicators\Keltner Channel\GetIndicatorBuffers.mqh>
#include <Crosses.mqh>
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=KeltnerChannelSignal                                       |
//| Type=SignalAdvanced                                              |
//| Name=KeltnerChannel                                              |
//| Class=CKeltnerChannelSignal                                      |
//| Page=                                                            |
//| Parameter=Timeframe,int,12,PERIOD_CURRENT,Timeframe              |
//| Parameter=MAPeriod,int,20,MA period                              |
////| Parameter=MAMethod,enMaModes,ma_Simple,MA smoothing method       | -> not custom enums
//| Parameter=MAMethod,ENUM_MA_METHOD,MODE_SMA,MA smoothing method     | -> it's right: mql5 enums
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
//| The CKeltnerChannelSignal class.                                 |
//| Purpose: Class of trading signal generator                       |
//|          It is derived from the CExpertSignal class.             |
//+------------------------------------------------------------------+
class CKeltnerChannelSignal : public CExpertSignal
  {
protected:
   //--- Indicators
   CiCustom          KeltnerChannel;

   //--- Setup parameters
   ENUM_TIMEFRAMES   m_timeframe;         //1  Time frame
   int               m_ma_period;         //2  Moving average period
   //enMaModes         m_ma_method;         //3  Moving average type    -> not custom enums
   ENUM_MA_METHOD    m_ma_method;         //3  Moving average type      -> it's right: mql5 enums
   enMaVisble        m_ma_visible;        //4  Midlle line visible?
   enPrices          m_price_type;        //5  Moving average price type
   color             m_color_slope_up;    //6  Color for slope up
   color             m_color_slope_down;  //7  Color for slope down
   int               m_atr_period;        //8  Range period
   double            m_atr_multiplier;    //9  Range multiplier
   enAtrMode         m_atr_mode;          //10 Range calculating mode
   enCandleMode      m_view_bars;         //11 View bars as:
   bool              m_interpolate;       //12 Interpolate mtf data

public:
   //--- Methods to set the parameters
   void              Timeframe(ENUM_TIMEFRAMES value)    {m_timeframe         = value;}
   void              MAPeriod(int value)                 {m_ma_period         = value;}
   //void              MAMethod(enMaModes value)           {m_ma_method         = value;}
   void              MAMethod(ENUM_MA_METHOD value)      {m_ma_method         = value;}
  };
//+------------------------------------------------------------------+
 
Vladimir Karputov:
You can apply ONLY MQL5 enum! Custom enum is FORBIDDEN!

Example:

That's what is wrong! Should I cast them to int? I guess that the user won't be able to select a custom enum value from the wizard. Thanks I will try this!