CheckTrailingStop

Verifica as condições de Trailing Stop da posição aberta.

virtual bool  CheckTrailingStop()

Valor de retorno

verdadeiro se qualquer operação de negociação foi executada, caso contrário é falso.

Observação

Verifica as condições de Trailing Stop da posição aberta (CheckTrailingStopLong() ou CheckTrailingStopShort() para as posições compradas e vendidas).

Implementação

//+------------------------------------------------------------------+
//| 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);
  }