Can someone please explain this code? And is it neccessary for tickdata backtesting?

 

 #include <CustomChartingBacktest.mqh>

and at the very top of the void OnTick() function add the following function call:

if(skipFirstTickOnBacktest()) return;

 

//+------------------------------------------------------------------+
//|                                       CustomChartingBacktest.mqh |
//|                                        Copyright 2012, AZ-INVEST |
//|                                          http://www.az-invest.eu |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, AZ-INVEST"
#property link      "http://www.az-invest.eu"

bool skipFirstTickOnBacktest()
{
   if(!IsTesting())
      return(false);
      
   static datetime lastbar;
   RefreshRates();
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }   
}
Reason: