Previous Next

GBar.CandleFullSpread()

Returns the full size of a candle.

double  GBar.CandleFullSpread(
   int              shift,                     // Shift
   ENUM_TIMEFRAMES  timeFrame = PERIOD_CURRENT // Time frame of the value
);

Parameter

shift

[in]  Shift the candle. 0 (Zero) is the actual unfinished candle.

timeFrame

[in]  The timeframe of the candle.

Return Value

Returns the range from the lowest to the highest point of a candle.


Example:

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

//--- Generate 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 memory on closing
   delete bar;
}


void OnTick ()
{
   //--- Output the full spread of the last bar
   Print( bar.CandleFullSpread(1) );
}


See also

GBar.CandleBodySpread