All about MQL5 Wizard : create robots without programming. - page 10

 

MQL5 Wizard Techniques you should know (Part 70): Using Patterns of SAR and the RVI with a Exponential Kernel Network

MQL5 Wizard Techniques you should know (Part 70): Using Patterns of SAR and the RVI with a Exponential Kernel Network

In the last article, we introduced this complimentary pair of the Parabolic SAR indicator (SAR) and the Relative Vigour Index oscillator (RVI). From our testing of 10 patterns, three failed to perform clean forward walks; namely those indexed 1, 2, and 6. Our indexing of these patterns from 0 to 9 allows us to easily compute the map value that allows their exclusive use by the Expert Advisor. For instance, if a pattern is indexed 1 then we have to set the parameter ‘PatternsUsed’ to 2 to the power 1 which comes to 2. 
MQL5 Wizard Techniques you should know (Part 70): Using Patterns of SAR and the RVI with a Exponential Kernel Network
MQL5 Wizard Techniques you should know (Part 70): Using Patterns of SAR and the RVI with a Exponential Kernel Network
  • www.mql5.com
We follow up our last article, where we introduced the indicator pair of the SAR and the RVI, by considering how this indicator pairing could be extended with Machine Learning. SAR and RVI are a trend and momentum complimentary pairing. Our machine learning approach uses a convolution neural network that engages the Exponential kernel in sizing its kernels and channels, when fine-tuning the forecasts of this indicator pairing. As always, this is done in a custom signal class file that works with the MQL5 wizard to assemble an Expert Advisor.
 

MQL5 Wizard Techniques you should know (Part 71): Using Patterns of MACD and the OBV

The Moving Average Convergence Divergence oscillator, a trend tracking oscillator (MACD) is paired with the On Balance Volume oscillator (OBV). These two complement each other since one tracks trend while the other measures volume. We perform tests using the pair GBP JPY on the year 2023 with the year 2024 serving as a forward walk test window. Our ‘training’ or optimization for the year 2023; besides seeking the ideal pattern signal weight; also seeks entry price gaps and take-profit targets. This is all done while no stop-loss is being used, meaning we rely solely on the close threshold weight of the custom signal class to close any positions that are no longer inline with their open thesis.
MQL5 Wizard Techniques you should know (Part 71): Using Patterns of MACD and the OBV
MQL5 Wizard Techniques you should know (Part 71): Using Patterns of MACD and the OBV
  • www.mql5.com
The Moving-Average-Convergence-Divergence (MACD) oscillator and the On-Balance-Volume (OBV) oscillator are another pair of indicators that could be used in conjunction within an MQL5 Expert Advisor. This pairing, as is practice in these article series, is complementary with the MACD affirming trends while OBV checks volume. As usual, we use the MQL5 wizard to build and test any potential these two may possess.
 

MQL5 Wizard Techniques you should know (Part 72): Using Patterns of MACD and the OBV with Supervised Learning

MQL5 Wizard Techniques you should know (Part 72): Using Patterns of MACD and the OBV with Supervised Learning

In our last article, where we introduced the indicator pair of the MACD and On-Balance-Volume oscillator (OBV) we examined 10 possible signals that could be generated from the complimentary pairing of these indicators. We always test 10 signal patterns as derived from a 2-indicator-pairing by performing a forward walk test for 1-year, having done training or optimization over the previous year. With the last article, only one signal pattern, pattern-7, was able to forward walk profitably. We went over some of the reasons why this indicator pairing performed dismally when compared to other indicators we have covered, however this also presented an ‘opportunity’ for us to explore machine learning in enhancing some of these signal patterns.
MQL5 Wizard Techniques you should know (Part 72): Using Patterns of MACD and the OBV with Supervised Learning
MQL5 Wizard Techniques you should know (Part 72): Using Patterns of MACD and the OBV with Supervised Learning
  • www.mql5.com
We follow up on our last article, where we introduced the indicator pair of the MACD and the OBV, by looking at how this pairing could be enhanced with Machine Learning. MACD and OBV are a trend and volume complimentary pairing. Our machine learning approach uses a convolution neural network that engages the Exponential kernel in sizing its kernels and channels, when fine-tuning the forecasts of this indicator pairing. As always, this is done in a custom signal class file that works with the MQL5 wizard to assemble an Expert Advisor.
 

MQL5 Wizard Techniques you should know (Part 73): Using Patterns of Ichimoku and the ADX-Wilder

MQL5 Wizard Techniques you should know (Part 73): Using Patterns of Ichimoku and the ADX-Wilder

The Ichimoku Kinko Hyo (Ichimoku) indicator and ADX-Wilder (ADX) oscillator are used in this article in a support/resistance and trend-identification pairing. The Ichimoku is certainly multifaceted and quite versatile. It can provide more than just support/ resistance levels. However, we are sticking to just S/R for now. Indicator pairings, especially when complimentary, have the potential to spun more incisive and accurate entry signals for Expert Advisors. As usual, we examine 10 signal patterns of this indicator pairing. We test these 10 signal patterns that are each assigned an index, one at a time, while being guided by these rules;

Indexing is from 0 to 9 allowing us to easily compute the map value for their exclusive use by the Expert Advisor. For instance, if a pattern is indexed 1 then we have to set the parameter ‘PatternsUsed’ to 2 to the power 1 which comes to 2. If the index is 4 then this is 2 to the power 4 which comes to 16, and so on. The maximum value that this parameter can be assigned, meaningfully, is 1023 since we have only 10 parameters. Any number between 0 and 1023 that is not a pure exponent of 2 would represent a combination of more than one of these 10 patterns.

MQL5 Wizard Techniques you should know (Part 73): Using Patterns of Ichimoku and the ADX-Wilder
MQL5 Wizard Techniques you should know (Part 73): Using Patterns of Ichimoku and the ADX-Wilder
  • 2025.07.04
  • www.mql5.com
The Ichimoku-Kinko-Hyo Indicator and the ADX-Wilder oscillator are a pairing that could be used in complimentarily within an MQL5 Expert Advisor. The Ichimoku is multi-faceted, however for this article, we are relying on it primarily for its ability to define support and resistance levels. Meanwhile, we also use the ADX to define our trend. As usual, we use the MQL5 wizard to build and test any potential these two may possess.
 

MQL5 Wizard Techniques you should know (Part 74): Using Patterns of Ichimoku and the ADX-Wilder with Supervised Learning

MQL5 Wizard Techniques you should know (Part 74): Using Patterns of Ichimoku and the ADX-Wilder with Supervised Learning

In the last article, we looked at the indicator pairing of Ichimoku and the ADX-Wilder as a complimentary S/R and trend tool pairing. As usual, we tested these in a wizard assembled Expert Advisor and looked at 10 different signal patterns. For this indicator pairing, most of them were able to forward walk profitably for 1-year, having done testing/ optimization on the previous year. However, there were 3 that did not do so satisfactorily and these were pattern-0, pattern-1, and pattern-5. We therefore follow up that article by examining if supervised learning can make a difference to their performance. Our approach in this is to reconstruct the signals of each of these patterns as a simple input vector into a neural network, essentially making the neural network an extra filter to the signal.
MQL5 Wizard Techniques you should know (Part 74): Using Patterns of Ichimoku and the ADX-Wilder with Supervised Learning
MQL5 Wizard Techniques you should know (Part 74): Using Patterns of Ichimoku and the ADX-Wilder with Supervised Learning
  • 2025.07.10
  • www.mql5.com
We follow up on our last article, where we introduced the indicator pair of the Ichimoku and the ADX, by looking at how this duo could be improved with Supervised Learning. Ichimoku and ADX are a support/resistance plus trend complimentary pairing. Our supervised learning approach uses a neural network that engages the Deep Spectral Mixture Kernel to fine tune the forecasts of this indicator pairing. As per usual, this is done in a custom signal class file that works with the MQL5 wizard to assemble an Expert Advisor.
 

MQL5 Wizard Techniques you should know (Part 75): Using Awesome Oscillator and the Envelopes

MQL5 Wizard Techniques you should know (Part 75): Using Awesome Oscillator and the Envelopes

The combination of the awesome oscillator with envelopes channel is another indicator pairing that we are considering where we merge the synergies of trend following with support/resistance identification. We again consider 10 possible signal patterns that can be got from this pairing and perform evaluation tests on the pair USD JPY on the 30-minute timeframe for the year 2023 with forward tests being on the year 2024. Before jumping into the signal patterns, let's look at the basic definitions of each of these indicators, starting with the awesome oscillator. This was developed by the late Bill Williams as a trend indicator that compares short-term and long-term averages of the midpoint of an asset’s price.
MQL5 Wizard Techniques you should know (Part 75): Using Awesome Oscillator and the Envelopes
MQL5 Wizard Techniques you should know (Part 75): Using Awesome Oscillator and the Envelopes
  • 2025.07.17
  • www.mql5.com
The Awesome Oscillator by Bill Williams and the Envelopes Channel are a pairing that could be used complimentarily within an MQL5 Expert Advisor. We use the Awesome Oscillator for its ability to spot trends, while the envelopes channel is incorporated to define our support/resistance levels. In exploring this indicator pairing, we use the MQL5 wizard to build and test any potential these two may possess.
 
Sergey Golubev #:

Can you help me to start trading
 
AVAG DANIELYAN #:
Can you help me to start trading
read post  about how to start
 

I made a Signal of Candle Patterns. Copy&paste&test. Works pretty good on high timeframes.

//+------------------------------------------------------------------+
//|                                         SignalCandlePatterns.mqh |
//|                             Copyright 2000-2025, MetaQuotes Ltd. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#include <Expert\ExpertSignal.mqh>
// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=Signals of Candle Patterns                                 |
//| Type=SignalAdvanced                                              |
//| Name=Candle Patterns                                             |
//| ShortName=CandlePatterns                                         |
//| Class=CSignalCandlePatterns                                      |
//| Page=signal_candle_patterns                                      |
//| Parameter=EngulfingWeight,int,100,Weight on Engulfing pattern    |
//| Parameter=HammerWeight,int,80,Weight on Hammer pattern           |
//| Parameter=DojiWeight,int,60,Weight on Doji                       |
//| Parameter=StarWeight,int,90,Weight on Morning/Evening Star       |
//| Parameter=CloudPiercingWeight,int,70,Weight on Piercing/Dark CC  |
//| Parameter=TweezerWeight,int,50,Weight on Tweezer Tops/Bottoms    |
//| Parameter=HaramiWeight,int,40,Weight on Harami                   |
//| Parameter=HammerMinBodyRatio,double,0.10,Min body/range for Hammer|
//| Parameter=HammerLongShadowRatio,double,2.0,Min lower‐shadow/body for Hammer|
//| Parameter=HammerShortShadowMaxRatio,double,0.5,Max upper‐shadow/body for Hammer|
//| Parameter=StarMinBodyRatio,double,0.10,Min body/range for ShootingStar|
//| Parameter=StarLongShadowRatio,double,2.0,Min upper‐shadow/body for ShootingStar|
//| Parameter=StarShortShadowMaxRatio,double,0.5,Max lower‐shadow/body for ShootingStar|
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
class CSignalCandlePatterns : public CExpertSignal
  {
protected:
   //--- weights
   int    m_engulfing_weight;
   int    m_hammer_weight;
   int    m_doji_weight;
   int    m_star_weight;
   int    m_cloud_piercing_weight;
   int    m_tweezer_weight;
   int    m_harami_weight;
   //--- new filter parameters
   double m_hammer_min_body_ratio;
   double m_hammer_long_shadow_ratio;
   double m_hammer_short_shadow_max_ratio;
   double m_star_min_body_ratio;
   double m_star_long_shadow_ratio;
   double m_star_short_shadow_max_ratio;

public:
                     CSignalCandlePatterns(void);
                    ~CSignalCandlePatterns(void);

   //--- setters for weights
   void              EngulfingWeight(int v)         { m_engulfing_weight=v; }
   void              HammerWeight(int v)            { m_hammer_weight=v;    }
   void              DojiWeight(int v)              { m_doji_weight=v;      }
   void              StarWeight(int v)              { m_star_weight=v;      }
   void              CloudPiercingWeight(int v)     { m_cloud_piercing_weight=v; }
   void              TweezerWeight(int v)           { m_tweezer_weight=v;   }
   void              HaramiWeight(int v)            { m_harami_weight=v;    }

   //--- setters for new filters
   void              HammerMinBodyRatio(double v)        { m_hammer_min_body_ratio=v; }
   void              HammerLongShadowRatio(double v)     { m_hammer_long_shadow_ratio=v; }
   void              HammerShortShadowMaxRatio(double v) { m_hammer_short_shadow_max_ratio=v; }
   void              StarMinBodyRatio(double v)          { m_star_min_body_ratio=v; }
   void              StarLongShadowRatio(double v)       { m_star_long_shadow_ratio=v; }
   void              StarShortShadowMaxRatio(double v)   { m_star_short_shadow_max_ratio=v; }

   //--- core
   virtual bool      ValidationSettings(void);
   virtual bool      InitIndicators(CIndicators *indicators);
   virtual int       LongCondition(void);
   virtual int       ShortCondition(void);

protected:
   //--- pattern detectors
   bool              IsBullishEngulfing(int idx);
   bool              IsBearishEngulfing(int idx);
   bool              IsHammer(int idx);
   bool              IsShootingStar(int idx);
   bool              IsDoji(int idx);
   bool              IsMorningStar(int idx);
   bool              IsEveningStar(int idx);
   bool              IsPiercingLine(int idx);
   bool              IsDarkCloudCover(int idx);
   bool              IsTweezerBottom(int idx);
   bool              IsTweezerTop(int idx);
   bool              IsBullishHarami(int idx);
   bool              IsBearishHarami(int idx);
  };

//+------------------------------------------------------------------+
//| Constructor                                                      |
//+------------------------------------------------------------------+
CSignalCandlePatterns::CSignalCandlePatterns(void)
 : m_engulfing_weight(100),
   m_hammer_weight(80),
   m_doji_weight(60),
   m_star_weight(90),
   m_cloud_piercing_weight(70),
   m_tweezer_weight(50),
   m_harami_weight(40),
   m_hammer_min_body_ratio(0.10),
   m_hammer_long_shadow_ratio(2.0),
   m_hammer_short_shadow_max_ratio(0.5),
   m_star_min_body_ratio(0.10),
   m_star_long_shadow_ratio(2.0),
   m_star_short_shadow_max_ratio(0.5)
  {
   m_used_series = USE_SERIES_OPEN|USE_SERIES_HIGH|USE_SERIES_LOW|USE_SERIES_CLOSE;
  }

//+------------------------------------------------------------------+
//| Destructor                                                       |
//+------------------------------------------------------------------+
CSignalCandlePatterns::~CSignalCandlePatterns(void) {}

//+------------------------------------------------------------------+
//| Validate settings                                                |
//+------------------------------------------------------------------+
bool CSignalCandlePatterns::ValidationSettings(void)
  {
   if(!CExpertSignal::ValidationSettings())
      return(false);
   // weights ≥ 0
   int weights[] = {
      m_engulfing_weight,
      m_hammer_weight,
      m_doji_weight,
      m_star_weight,
      m_cloud_piercing_weight,
      m_tweezer_weight,
      m_harami_weight
   };
   for(int i=0; i<ArraySize(weights); i++)
      if(weights[i] < 0)
        {
         printf(__FUNCTION__+": tutti i pesi devono essere >= 0");
         return(false);
        }
   // ratios > 0
   if(m_hammer_min_body_ratio       <= 0 ||
      m_hammer_long_shadow_ratio    <= 0 ||
      m_hammer_short_shadow_max_ratio<= 0 ||
      m_star_min_body_ratio         <= 0 ||
      m_star_long_shadow_ratio      <= 0 ||
      m_star_short_shadow_max_ratio <= 0)
     {
      printf(__FUNCTION__+": tutti i ratio devono essere > 0");
      return(false);
     }
   return(true);
  }

//+------------------------------------------------------------------+
//| InitIndicators (none external)                                   |
//+------------------------------------------------------------------+
bool CSignalCandlePatterns::InitIndicators(CIndicators *indicators)
  {
   return(CExpertSignal::InitIndicators(indicators));
  }

//+------------------------------------------------------------------+
//| Long on previous candle                                         |
//+------------------------------------------------------------------+
int CSignalCandlePatterns::LongCondition(void)
  {
   int weight = 0;
   int idx    = StartIndex() + 1; // last closed bar

   weight = MathMax(weight, IsBullishEngulfing(idx)    ? m_engulfing_weight       : 0);
   weight = MathMax(weight, IsHammer(idx)              ? m_hammer_weight          : 0);
   weight = MathMax(weight, IsDoji(idx)                ? m_doji_weight            : 0);
   weight = MathMax(weight, IsMorningStar(idx)         ? m_star_weight            : 0);
   weight = MathMax(weight, IsPiercingLine(idx)        ? m_cloud_piercing_weight  : 0);
   weight = MathMax(weight, IsTweezerBottom(idx)       ? m_tweezer_weight         : 0);
   weight = MathMax(weight, IsBullishHarami(idx)       ? m_harami_weight          : 0);

   if(weight > 0) m_base_price = 0.0;
   return(weight);
  }

//+------------------------------------------------------------------+
//| Short on previous candle                                        |
//+------------------------------------------------------------------+
int CSignalCandlePatterns::ShortCondition(void)
  {
   int weight = 0;
   int idx    = StartIndex() + 1;

   weight = MathMax(weight, IsBearishEngulfing(idx)    ? m_engulfing_weight       : 0);
   weight = MathMax(weight, IsShootingStar(idx)        ? m_hammer_weight          : 0);
   weight = MathMax(weight, IsDoji(idx)                ? m_doji_weight            : 0);
   weight = MathMax(weight, IsEveningStar(idx)         ? m_star_weight            : 0);
   weight = MathMax(weight, IsDarkCloudCover(idx)      ? m_cloud_piercing_weight  : 0);
   weight = MathMax(weight, IsTweezerTop(idx)          ? m_tweezer_weight         : 0);
   weight = MathMax(weight, IsBearishHarami(idx)       ? m_harami_weight          : 0);

   if(weight > 0) m_base_price = 0.0;
   return(weight);
  }

//+------------------------------------------------------------------+
//| Price macros via iOpen/iClose/iHigh/iLow                         |
//+------------------------------------------------------------------+
#define O(i)  iOpen(m_symbol.Name(), m_period, i)
#define C(i)  iClose(m_symbol.Name(), m_period, i)
#define H(i)  iHigh(m_symbol.Name(), m_period, i)
#define L(i)  iLow(m_symbol.Name(), m_period, i)

//+------------------------------------------------------------------+
//| Pattern implementations                                          |
//+------------------------------------------------------------------+
bool CSignalCandlePatterns::IsBullishEngulfing(int idx)
  {
   return(
      C(idx+1) < O(idx+1) &&
      C(idx)   > O(idx)   &&
      O(idx)   < C(idx+1) &&
      C(idx)   > O(idx+1)
   );
  }

bool CSignalCandlePatterns::IsBearishEngulfing(int idx)
  {
   return(
      C(idx+1) > O(idx+1) &&
      C(idx)   < O(idx)   &&
      O(idx)   > C(idx+1) &&
      C(idx)   < O(idx+1)
   );
  }

bool CSignalCandlePatterns::IsHammer(int idx)
  {
   double o      = O(idx);
   double c      = C(idx);
   double h      = H(idx);
   double l      = L(idx);
   double range  = h - l;
   if(range <= 0) return(false);

   double body      = MathAbs(c - o);
   double minOC     = (o < c ? o : c);
   double maxOC     = (o > c ? o : c);
   double lowerWick = minOC - l;
   double upperWick = h - maxOC;

   if(body < m_hammer_min_body_ratio * range)        return(false);
   if(lowerWick < m_hammer_long_shadow_ratio * body) return(false);
   if(upperWick > m_hammer_short_shadow_max_ratio * body) return(false);

   return(true);
  }

bool CSignalCandlePatterns::IsShootingStar(int idx)
  {
   double o      = O(idx);
   double c      = C(idx);
   double h      = H(idx);
   double l      = L(idx);
   double range  = h - l;
   if(range <= 0) return(false);

   double body      = MathAbs(c - o);
   double minOC     = (o < c ? o : c);
   double maxOC     = (o > c ? o : c);
   double upperWick = h - maxOC;
   double lowerWick = minOC - l;

   if(body < m_star_min_body_ratio * range)          return(false);
   if(upperWick < m_star_long_shadow_ratio * body)   return(false);
   if(lowerWick > m_star_short_shadow_max_ratio * body) return(false);

   return(true);
  }

bool CSignalCandlePatterns::IsDoji(int idx)
  {
   double o = O(idx);
   double c = C(idx);
   double h = H(idx);
   double l = L(idx);
   return(MathAbs(c - o) <= (h - l) * 0.1);
  }

bool CSignalCandlePatterns::IsMorningStar(int idx)
  {
   if(C(idx+2) >= O(idx+2))                                    return(false);
   if(MathAbs(C(idx+1) - O(idx+1)) > (H(idx+1) - L(idx+1)))   return(false);
   if(C(idx) <= O(idx))                                       return(false);
   return(
     C(idx) > O(idx+2) - (O(idx+2) - C(idx+2)) / 2
   );
  }

bool CSignalCandlePatterns::IsEveningStar(int idx)
  {
   if(C(idx+2) <= O(idx+2))                                    return(false);
   if(MathAbs(C(idx+1) - O(idx+1)) > (H(idx+1) - L(idx+1)))   return(false);
   if(C(idx) >= O(idx))                                       return(false);
   return(
     C(idx) < O(idx+2) + (C(idx+2) - O(idx+2)) / 2
   );
  }

bool CSignalCandlePatterns::IsPiercingLine(int idx)
  {
   return(
      C(idx+1) < O(idx+1) &&
      C(idx)   > O(idx)   &&
      O(idx)   < L(idx+1) &&
      C(idx)   > O(idx+1) - (O(idx+1) - C(idx+1)) / 2
   );
  }

bool CSignalCandlePatterns::IsDarkCloudCover(int idx)
  {
   return(
      C(idx+1) > O(idx+1) &&
      C(idx)   < O(idx)   &&
      O(idx)   > H(idx+1) &&
      C(idx)   < O(idx+1) + (C(idx+1) - O(idx+1)) / 2
   );
  }

bool CSignalCandlePatterns::IsTweezerBottom(int idx)
  {
   return(
      C(idx+1) < O(idx+1) &&
      C(idx)   > O(idx)   &&
      MathAbs(L(idx+1) - L(idx)) < _Point * 10
   );
  }

bool CSignalCandlePatterns::IsTweezerTop(int idx)
  {
   return(
      C(idx+1) > O(idx+1) &&
      C(idx)   < O(idx)   &&
      MathAbs(H(idx+1) - H(idx)) < _Point * 10
   );
  }

bool CSignalCandlePatterns::IsBullishHarami(int idx)
  {
   return(
      C(idx+1) < O(idx+1) &&
      C(idx)   > O(idx)   &&
      O(idx)   > C(idx+1) &&
      C(idx)   < O(idx+1)
   );
  }

bool CSignalCandlePatterns::IsBearishHarami(int idx)
  {
   return(
      C(idx+1) > O(idx+1) &&
      C(idx)   < O(idx)   &&
      O(idx)   < C(idx+1) &&
      C(idx)   > O(idx+1)
   );
  }
//+------------------------------------------------------------------+
 

This is a weekday filter with simple bools to enable/disable each day of week. Way simpler to setup.


//+------------------------------------------------------------------+
//|                                             SignalDayFilter.mqh   |
//+------------------------------------------------------------------+
#include <Expert\ExpertSignal.mqh>

// wizard description start
//+------------------------------------------------------------------+
//| Description of the class                                         |
//| Title=Signal Day Filter by Weekday                               |
//| Type=SignalAdvanced                                              |
//| Name=DayOfWeekFilter                                             |
//| ShortName=DF                                                     |
//| Class=CSignalDayFilter                                           |
//| Page=signal_day_filter                                           |
//| Parameter=EnableSunday,bool,true,Enable domenica                 |
//| Parameter=EnableMonday,bool,true,Enable lunedì                   |
//| Parameter=EnableTuesday,bool,true,Enable martedì                 |
//| Parameter=EnableWednesday,bool,true,Enable mercoledì             |
//| Parameter=EnableThursday,bool,true,Enable giovedì                |
//| Parameter=EnableFriday,bool,true,Enable venerdì                  |
//| Parameter=EnableSaturday,bool,true,Enable sabato                 |
//+------------------------------------------------------------------+
// wizard description end

class CSignalDayFilter : public CExpertSignal
  {
protected:
   long m_bad_days_of_week;

public:
                     CSignalDayFilter(void) : m_bad_days_of_week(0) {}
                    ~CSignalDayFilter(void) {}

   // setter invocati dal Wizard:
   void EnableSunday   (bool enable) { if(!enable) m_bad_days_of_week |= (1<<0); else m_bad_days_of_week &= ~(1<<0); }
   void EnableMonday   (bool enable) { if(!enable) m_bad_days_of_week |= (1<<1); else m_bad_days_of_week &= ~(1<<1); }
   void EnableTuesday  (bool enable) { if(!enable) m_bad_days_of_week |= (1<<2); else m_bad_days_of_week &= ~(1<<2); }
   void EnableWednesday(bool enable) { if(!enable) m_bad_days_of_week |= (1<<3); else m_bad_days_of_week &= ~(1<<3); }
   void EnableThursday (bool enable) { if(!enable) m_bad_days_of_week |= (1<<4); else m_bad_days_of_week &= ~(1<<4); }
   void EnableFriday   (bool enable) { if(!enable) m_bad_days_of_week |= (1<<5); else m_bad_days_of_week &= ~(1<<5); }
   void EnableSaturday (bool enable) { if(!enable) m_bad_days_of_week |= (1<<6); else m_bad_days_of_week &= ~(1<<6); }

   virtual double Direction(void)
     {
      MqlDateTime now;
      TimeCurrent(now);
      // se il bit è 1 => giorno disabilitato
      if((m_bad_days_of_week & (1<<now.day_of_week)) != 0)
         return(EMPTY_VALUE);
      return(0.0);
     }
  };
//+------------------------------------------------------------------+