Previous Next


Checks if the data of the class is ready for use.

After a class has been created and initialized, it needs a few ticks to collect all the data. This function checks if the data is ready for use.

This can prevent errors when starting an expert based on the data from Glib.

bool  GChartPatterns.Ready();

Return value

In case of success, true is returned and a message is output that the class data is ready.


//--- Including Glib classes
#include <Glib.mqh>

//--- Creation of a pointer to an empty class object
GChartPatterns *chartPatterns;

int OnInit ()
   //--- Assign the class to the empty class object
   chartPatterns = gChartPatterns();

   //--- Initialize the class data


void OnDeinit(const int reason)
   //--- Free memory
   delete chartPatterns;

void OnTick ()
   if ( chartPatterns.Ready() ) //--- Will only be executed when all data are ready
      //--- Draw the chart

See also