Previous Next

GSupportAndResistance.InitPivots()

This function is used to prepare the pivot data of GSupportAndResistance.

The call must take place before the first call of a data-reading function.

void  GSupportAndResistance.InitPivots(
   string   Periodes = "MN1,W1,D1"    // Timeframes in short notation
   );

Parameter

Periods

[in]  The timeframes on which the class should process the data. These are specified in shorthand and separated by a comma without spaces. "H1,W1" thus corresponds to PERIOD_H1 and PERIOD_W1 or 1 hour and 1 week.


Example:

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

//--- Create a pointer to an empty class object
GSupportAndResistance *supportAndResistance;


int OnInit ()
{
   //--- Assign the class to the empty class object
   supportAndResistance = gSupportAndResistance();

   //--- Initialize the class data
   supportAndResistance.Init();

   //--- Initialize the pivot points
   supportAndResistance.InitPivots();

   return(INIT_SUCCEEDED);
}

void OnDeinit (const int reason)
{
   //--- Free up memory on exit
   delete supportAndResistance;
}


See also

SupportAndResistance, GSupportAndResistance.GetPivots, GSupportAndResistance.Init, GSupportAndResistance.SetFontSize, GSupportAndResistance.SetMarkersLengthRight