Previous Next

GTrade.OpenStopLoss()

Returns the value of the StopLoss of the last opened and open trade on a certain symbol.

double  GTrade.OpenStopLoss(
   string  symbol = NULL  // Symbol
   );

Parameters

symbol

[in]  The symbol of which the value should be output.

Return value

Returns the value of the StopLoss of the last opened trade.


Example:

//--- Include the Glib classes
#include <Glib.mqh>

//--- Creation of a pointer to an empty class object
GTrade *trade;


int OnInit ()
{
   //--- Assign the class to the empty class object
   trade = gTrade();

   //--- Initialize the data of the class
   trade.Init();

   return(INIT_SUCCEEDED);
}

void OnDeinit (const int reason)
{
   //--- Release memory on exit
   delete trade;
}


void OnTick ()
{
   //--- Get the StopLoss of the last opened trade
   Print( trade.OpenStopLoss() );
}


See also

GTrade.OpenStopLossWithComment, GTrade.MoveStopLoss, GTrade.MoveStopLossWithComment