Previous Next

GSupportAndResistance.SetFontSize()

To set the text size of the automatic chart drawings.

void  GSupportAndResistance.SetFontSize(
   int  size = 6  // font size in pixel
   );

Parameter

size

[in]  The desired font size in pixels of the captions on the automatically created graphics.


Example:

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

//--- Creation of 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();

   //--- Set the font size
   supportAndResistance.SetFontSize(10); // Sets the font size for the text.

   return(INIT_SUCCEEDED);
}

void OnDeinit(const int reason)
{
   //--- Release memory when exiting
   delete supportAndResistance;
}


void OnTick ()
{
   if ( supportAndResistance.Ready() ) //--- Runs only when all data is ready
   {
      //--- Draw the set data on the chart
      supportAndResistance.Paint();
   }
}


See also

GSupportAndResistance.Paint, GSupportAndResistance.SetMarkersLenghtRight