Help with a mistake, please!

 
Good afternoon!

Does anyone help me find my mistake here?

It compiles, but does not separate the orders according to the ENUM: Buy, Sell and Buy_Sell ... In the 3 configurations it buys and sells ...


//| Class=CPriceAction                                               |
//+------------------------------------------------------------------+
// wizard description end
//+------------------------------------------------------------------+
enum Type_Orders 
   { 
   BUY, 
   SELL, 
   BUY_SELL
   }; 

//+------------------------------------------------------------------+
//| CPriceAction class                                               |
//| Purpose: A class of a module of trade signals,                   |
//| Price action                                                     |
//+------------------------------------------------------------------+
class CPriceAction : public CExpertSignal
  {
public:
   Type_Orders m_positions;
   void CPriceAction(){ m_used_series=USE_SERIES_OPEN+USE_SERIES_HIGH+USE_SERIES_LOW+USE_SERIES_CLOSE;  }  
private:
   virtual bool      CheckOpen(void);
   
   void SetAvailablePositions(Type_Orders newValue){m_positions=newValue;}; 
   virtual int       LongCondition();       //checks conditions for buy
   virtual int       ShortCondition();      //checks conditions for sell
   };
//+------------------------------------------------------------------+
//| Checks Conditions for buy                                        |
//| INPUT:  None                                                     |
//| OUTPUT: Weight from 0 to 100                                     |
//| REMARK: None.                                                    |
//+------------------------------------------------------------------+
int CPriceAction::LongCondition()
{
  ...

//--- condition is not satisfied
   return(0);
}
//+------------------------------------------------------------------+
//| Checks Conditions for sell                                       |
//| INPUT:  None                                                     |
//| OUTPUT: Weight from 0 to 100                                     |
//| REMARK: None.                                                    |
//+------------------------------------------------------------------+
int CPriceAction::ShortCondition()
{
...

//--- condition is not satisfied
   return(0);
}
//+------------------------------------------------------------------+ 
//| Check allowed positions                                          | 
//+------------------------------------------------------------------+ 
bool CPriceAction :: CheckOpen() 
   {
    switch(m_positions) 
     { 
      case BUY: 
         return LongCondition();      //Only new long positions 
         break;
      case SELL: 
         return ShortCondition();     //Only new short positions
         break; 
      default: 
         return LongCondition() && ShortCondition(); //default behaviour 
         break;
     }
   }

Reason: