CheckTrailingStop

Проверяет необходимость модификации параметров позиции.

virtual bool  CheckTrailingStop()

Возвращаемое значение

true - выполнена какая-либо торговая операция, иначе - false.

Примечание

Проверяется необходимость модификации позиции (вызов метода CheckTrailingStopLong() для длинной позиции или CheckTrailingStopShort() для короткой позиции).

Реализация

//+------------------------------------------------------------------+
//| Check for trailing stop/profit position                          |
//| INPUT:  no.                                                      |
//| OUTPUT: true-if trade operation processed, false otherwise.      |
//| REMARK: no.                                                      |
//+------------------------------------------------------------------+
bool CExpert::CheckTrailingStop()
  {
//--- position must be selected before call
   if(m_position.PositionType()==POSITION_TYPE_BUY)
     {
      //--- check the possibility of modifying the long position
      if(CheckTrailingStopLong()) return(true);
     }
   else
     {
      //--- check the possibility of modifying the short position
      if(CheckTrailingStopShort()) return(true);
     }
//--- return without operations
   return(false);
  }