CheckTrailingStop

Prüft die Notwendigkeit Position-Eigenschaften zu ändern.

virtual bool  CheckTrailingStop()

Rückgabewert

Gibt true zurück wenn einige Operation ausgeführt ist, ansonsten gibt false zurück.

Hinweis

Prüft die Notwendigkeit eine Position zu ändern (Aufruf der CheckTrailingStopLong()-Methode für eine Long-Position und CheckTrailingStopShort() für eine Short-Position).

Implementierung

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