//+------------------------------------------------------------------+
int start()
{
int i,nCountedBars;
bool bFound;
double dCurrent;
nCountedBars=IndicatorCounted();
//---- last counted bar will be recounted
if(nCountedBars2)
{
nCountedBars--;
i=Bars-nCountedBars-1;
}
//----Up and Down Fractals
while(i>=2)
{
//----Fractals up
bFound=false;
dCurrent=High[i];
if(dCurrent>High[i+1] && dCurrent>High[i+2] && dCurrent>High[i-1] && dCurrent>High[i-2])
{
bFound=true;
ExtUpFractalsBuffer[i]=dCurrent;