Previous Next


Determines whether a candle is pokes a value.

If the body of the candle is below the desired value and only the highest point is above the value, the poke is considered true.

bool  GBar.PeakUpInto(
   int              shift,                     // Shift
   double           value,                     // Target price
   ENUM_TIMEFRAMES  timeFrame = PERIOD_CURRENT // Timeframe of the value



[in]  Bar index of the candle.


[in]  The price value to be checked for poke.


[in]  The timeframe of the candle.

Return value

Returns true if the desired candle pokes the target value.


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

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

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

   //--- Initialize the class data

   //--- Initialize the pivot points


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

void OnTick ()
   if ( supportAndResistance.Ready() ) //--- Perform this code only if all data is ready
      //--- Draw values on chart

      //--- create double array
      double array[];

      //--- fill array
      supportAndResistance.GetPivots(array, PERIOD_D1);

      //--- check for completeness
      if (ArraySize(array) >= 7)
         //--- Checks if last candle pokes up into Daily-Pivot R1
         Print( bar.PeakUpInto(1, array[PIVOT_R1]) );

See also