Previous Next

GSupportAndResistance.ClearPaint()

Cleans the objects of all selected support and resistance lines, as well as pivot points automatically from the chart.

void  GSupportAndResistance.ClearPaint(
   ENUM_SUPPORTANDRESISTANCE  kind = SAR_ALL,  // Lines to be removed: SAR_ALL, SAR_SUPPORT, SAR_RESISTANCE or SAR_PIVOT
   ENUM_TIMEFRAMES            timeFrame = -1   // Time frame of the values
   );

Parameter

kind

[in]  The data to be removed. Allowed are SAR_ALL, SAR_SUPPORT, SAR_RESISTANCE or SAR_PIVOT. See ENUM_SUPPORTANDRESISTANCE.

timeFrame

[in]  Time frame of prices to be removed. -1 removes all active timeframes.

Rückgabewert

If successful, the desired objects are automatically removed from the chart.


Example:

//--- include the 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();

   return(INIT_SUCCEEDED);
}

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


void OnTick ()
{
   if ( supportAndResistance.Ready() ) //--- Will only be executed when all data is ready
   {
      //--- Remove data from the chart
      supportAndResistance.ClearPaint();
   }
}


See also

GSupportAndResistance.Paint