ReverseShort

Führt Operationen um eine Short-Position umzukehren

virtual bool  ReverseShort(
   double    price,    // Preis
   double    sl,       // Stop Loss
   double    tp        // Take Profit
   )

Parameter

price

[in] Markteintrittspreis.

sl

[in] Preis von Stop Loss.

tp

[in] Preis von Take Profit.

Rückgabewert

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

Hinweis

Die Lotgröße für Umkehr eine Short-Position wird durch den Aufruf von LotReverse()-Methode definiert. Wenn ein Lot nicht gleich 0.0 ist, kehrt die Short-Position um (Aufruf der Buy(...)-Methode vom Handelsobjekt).

Implementierung

//+------------------------------------------------------------------+
//| Short position reverse                                           |
//| INPUT:  price - price,                                           |
//|         sl    - stop loss,                                       |
//|         tp    - take profit.                                     |
//| OUTPUT: true-if trade operation processed, false otherwise.      |
//| REMARK: no.                                                      |
//+------------------------------------------------------------------+
bool CExpert::ReverseShort(double price,double sl,double tp)
  {
   if(price==EMPTY_VALUEreturn(false);
//--- get lot for reverse
   double lot=LotReverse(sl);
//--- check lot
   if(lot==0.0) return(false);
//---
   return(m_trade.Buy(lot,price,sl,tp));
  }