Previous Next

GBar.Bid()

Returns the current bid price.

double  GBar.Bid();

Return value

Returns the current bid.


Example:

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

//--- Create 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)
{
   //--- When finished free memory
   delete bar;
}


void OnTick ()
{
   //--- Outputs the current Bid price
   Print( bar.Bid() );
}


See also

GBar.Ask, GBar.Spread