CExpertSignal Ignore flag not working?

 

hey Guys, 

I am having issues understanding how the ignore flags are working for the signal's filters. Based on the documentation and following up the comments in the standard library module CExpertSignal, it should be possible to ignore the signal generated by filters through the m_ignore protected property:

double CExpertSignal::Direction(void)
  {
   long   mask;
   double direction;
   double result=m_weight*(LongCondition()-ShortCondition());
   int    number=(result==0.0)? 0 : 1;      // number of "voted"
//---
   int    total=m_filters.Total();
//--- loop by filters
   for(int i=0;i<total;i++)
     {
      //--- mask for bit maps
      mask=((long)1)<<i;
      //--- check of the flag of ignoring the signal of filter
      if((m_ignore&mask)!=0)
         continue;
      CExpertSignal *filter=m_filters.At(i);
      //--- check pointer
      if(filter==NULL)
         continue;
      direction=filter.Direction();
      //--- the "prohibition" signal
      if(direction==EMPTY_VALUE)
         return(EMPTY_VALUE);
      //--- check of flag of inverting the signal of filter
      if((m_invert&mask)!=0)
         result-=direction;
      else
         result+=direction;
      number++;
     }
//--- normalization
   if(number!=0)
      result/=number;
//--- return the result
   return(result);
  }

but following the code, the flags of filters are never being checked and only signal object's flag (not the filters) is being checked! 


I tried to set the flags in the main Expert source as follow :

//--- Creating filter CSignalAR
   CSignalAR *filter0=new CSignalAR;
   if(filter0==NULL)
     {
      //--- failed
      printf(__FUNCTION__+": error creating filter0");
      ExtExpert.Deinit();
      return(INIT_FAILED);
     }
   signal.AddFilter(filter0);
//--- Set filter parameters
   filter0.PeriodAR(Signal_AR_PeriodAR);
   filter0.Shift(Signal_AR_Shift);
   filter0.Overbought(Signal_AR_Overbought);
   filter0.Oversold(Signal_AR_Oversold);
   filter0.Weight(Signal_AR_Weight);
   filter0.Ignore(1);
//---


What am I missing? Any one has any experience with this issue? 

Thank you in advance for your help.


Cheers,

Zarik

Documentation on MQL5: Standard Library
Documentation on MQL5: Standard Library
  • www.mql5.com
Standard Library - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Zarik:

hey Guys, 

I am having issues understanding how the ignore flags are working for the signal's filters. Based on the documentation and following up the comments in the standard library module CExpertSignal, it should be possible to ignore the signal generated by filters through the m_ignore protected property:

but following the code, the flags of filters are never being checked and only signal object's flag (not the filters) is being checked! 


I tried to set the flags in the main Expert source as follow :


What am I missing? Any one has any experience with this issue? 

Thank you in advance for your help.


Cheers,

Zarik


So, In case anyone is interested or for future people who has the same issue as mine: after spending tremendous amount of time over this, I have to say that my question is not possible! You can not change the ignore flag of individual filters of CExperSignal. The original idea was to turn different filters based on different market conditions on and off but that's only possible if you dynamically changing the weight of the filter to 0 (basically neutralizing that filter) or mod the standard CExperSignal.