CheckTrailingStopLong

오픈된 롱 포지션의 추적 손절매 조건을 확인합니다.

virtual bool  CheckTrailingStopLong()

반환 값

거래 작업이 수행되었으면 true, 그게 아니면 false.

참고

오픈된 롱 포지션의 추적 손절매 조건(Expert 추적 개체의 CheckTrailingStopLong(...) 메서드)을 확인합니다. 조건이 충족되면 포지션 파라미터(TrailingStopLong(...) 메서드)를 수정합니다.

Implementation

//+------------------------------------------------------------------+
//| 추적 손절매/이익 실현 포지션을 확인합니다                     |
//| INPUT:  no.                                                      |
//| OUTPUT: 거래 작업이 진행된다면 true, 그렇지 않으면 false.      |
//| 비고: no.                                                      |
//+------------------------------------------------------------------+
bool CExpert::CheckTrailingStopLong()
  {
   double sl=EMPTY_VALUE;
   double tp=EMPTY_VALUE;
//--- 롱 추적 손절매 작업을 확인합니다
   if(m_trailing.CheckTrailingStopLong(GetPointer(m_position),sl,tp))
     {
      if(sl==EMPTY_VALUE) sl=m_position.StopLoss();
      if(tp==EMPTY_VALUE) tp=m_position.TakeProfit();
      //--- 롱 추적 손절매 작업
      return(TrailingStopLong(sl,tp));
     }
//--- 작업 없이 반환합니다
   return(false);
  }