Previous Next

GTrade.OpenStopLossWithComment()

Returns the value of the StopLoss of an open trade with a certain comment on a certain symbol.

double  GTrade.OpenStopLossWithComment(
   string  comment,       // Required comment for output
   string  symbol = NULL  // Symbol
   );

Parameter

comment

[in]  The comment that the open position must contain to output the value.

symbol

[in]  The comment of the last opened trade.

Return Value

Returns the value of the StopLoss of the last opened trade with a certain comment.


Example:

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

//--- Create 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 a specific open trade
   Print( trade.OpenStopLossWithComment("Auto Trade") );
}


See also

GTrade.OpenStopLoss, GTrade.MoveStopLoss, GTrade.MoveStopLossWithComment