Signal Module of Reverse Indicator

 

Hi, I'm trying to write a signal module of the indicator "Reverse no Repair" and an EA using this signal. Both have been compiled without error. However, it didn't open any order in backtesting. It seems that it's because of some bug in my signal module. Would anybody be so kind to tell me what's wrong with my signal module? Many Thanks! Here is the code of signal: ... (deleted) ...

Reverse No Repair
Reverse No Repair
  • www.mql5.com
The Reverse No Repair indicator can show bullish arrows and bearish arrows.
 

Before creating your module, it is recommended to study the indicator.

//+------------------------------------------------------------------+
//| "Voting" that the price will grow.                               |
//+------------------------------------------------------------------+
int CSignalRnR::LongCondition(void)
  {
   int result=0;
   int idx   =StartIndex();
   double value=bufferUp(idx);
   double value_idx_plus_1=bufferUp(idx+1);
   double value_idx_plus_2=bufferUp(idx+2);
   double value_idx_plus_3=bufferUp(idx+3);
   if(/*(idx + m_FilterCandle) < Bars(_Symbol,_Period) && */bufferUp(idx+1)!=0.0)
      result=100;
//--- return the result
   return(result);
  }
//+------------------------------------------------------------------+
//| "Voting" that the price will fall.                               |
//+------------------------------------------------------------------+
int CSignalRnR::ShortCondition(void)
  {
   int result  =0;
   int idx     =StartIndex();
   double value_idx=bufferDown(idx);
   double value_idx_plus_1=bufferDown(idx+1);
   double value_idx_plus_2=bufferDown(idx+2);
   double value_idx_plus_3=bufferDown(idx+3);
   if(/*(idx + m_FilterCandle) < Bars(_Symbol,_Period) && */bufferDown(idx+1)!=0.0)
      result=100;
//--- return the result
   return(result);
  }
 
Vladimir Karputov:

Before creating your module, it is recommended to study the indicator.

Thanks so much for your correction Vladimir! Yeah, it seems that I should take more time to study the indicator ...