Previous Next

GTrade.LastTradeProfit()

Returns the profit of the last closed trade.

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

Parameter

symbol

[in]  The symbol from which the value is to be output.

Return value

Returns the profit of the last closed trade.


Beispiel:

//--- Include 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 class data
   trade.Init();

   return(INIT_SUCCEEDED);
}

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


void OnTick ()
{
   //--- Get the profit of the last closed trade
   Print( trade.LastTradeProfit() );
}


See also

GTrade.LastTradeDate