Previous Next

GChartPatterns.GetBuild()

Returns a GStructChartPatterns object containing information about the current formation of a pattern in build.

GStructChartPatterns  GChartPatterns.GetBuild(
   ENUM_TIMEFRAMES                   timeFrame              // Timeframe of the desired formation
   GEnumChartPatternsIdentification  patternIdentification  // Formation identification
   );

Parameter

timeFrame

[in]  Time frame of the formation.

patternIdentification

[in]  GEnumChartPatternsIdentification of the developing formation that should be read out.

Return value

In case of success, a GStructChartPatterns object is returned. If no formation has been recognized yet, the parameters in the returned object are all 0 (zero). In case of an error, a message is additionally print.


Beispiel:

//--- Include 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
   chartPatterns.Init();

   return(INIT_SUCCEEDED);
}

void OnDeinit (const int reason)
{
   //--- On deinit, free memory
   delete chartPatterns;
}


void OnTick ()
{
   if ( chartPatterns.Ready() ) //--- Will be executed only when all data are ready
   {
      //--- Save the last formation and output the name:
      GStructChartPatterns tempBuildPattern = chartPatterns.GetBuild(PERIOD_D1, HEAD_SHOULDER);
      Print( tempBuildPattern.breakoutPointLong );

      //--- Output the completeness of the current formation:
      Print(chartPatterns.GetBuild(PERIOD_D1, HEAD_SHOULDER).completeness);
   }
}


See also

GChartPatterns.GetBuild, GChartPatterns.Signal, GChartPatterns.GetFinish, GChartPatterns.GetAllFinish