Previous Next

GBar.High()

Returns the highest price of a candle.

double  GBar.High(
   int              shift,                     // Offset
   ENUM_TIMEFRAMES  timeFrame = PERIOD_CURRENT // Timeframe of the value
);

Parameter

shift

[in]  Candle shift. 0 (zero) is the currently unfinished candle.

timeFrame

[in]  The timeframe of the candle.

Return Value

Returns the highest price of a candle.


Example:

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

//--- Creation of a pointer to an empty class object
GBar *bar;


int OnInit ()
{
   //--- Assign the class to the empty class object
   bar = gBar();

   return(INIT_SUCCEEDED);
}

void OnDeinit (const int reason)
{
   //--- free allocated memory
   delete bar;
}


void OnTick ()
{
   //--- print the highest price of the last bar
   Print( bar.High(1) );
}


See also

GBar.Low, GBar.Open, GBar.Close