Previous Next

GChartPatterns.SetPaintFinish()

Enable or disable drawing of completed patterns.

This function does not need to be called on every tick.

void  GChartPatterns.SetPaintFinish(
   bool  paint = true  // If true, formations are drawn
   );

Parameter

paint

[in]  If true, then finished formations are drawn.


Example:

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

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


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

   //--- Initialize the data of the class
   chartPatterns.Init();

   //--- Suppress drawing of formations in build
   chartPatterns.SetPaintBuild(false);

   //--- Do not draw finished patterns
   chartPatterns.SetPaintFinish(false);


   return(INIT_SUCCEEDED);
}

void OnDeinit (const int reason)
{
   //--- Free memory when closing
   delete chartPatterns;
}


void OnTick ()
{
   if ( chartPatterns.Ready() ) //--- Only executed when all data is ready
   {
      //--- Does not draw on the chart because SetPaintBuild and SetPaintFinish are false
      chartPatterns.JustPaint();
   }
}


See also

GChartPatterns.SetPaintBuild, GChartPatterns.JustPaint, GChartPatterns.ClearPaint