Find continous common vwap

hello everyone
i am trying to make an exploration where we can identify that there are continous common vwap within an "x" range
say for example range is defined as 1 percent than continous vwap days should be highlighed in exploration
i have made a sample excel of this idea
but i am not being able to get the necessary result in afl code
can someone here help me to improvise the code

i am attaching the excel screenshot
and also the afl result screenshot

we can try this on close too.

this is the afl -

//atp=avg traded price or vwap

atp=aux1;

SetOption("NoDefaultColumns", True);
AddTextColumn( name(), "NAME", 1, textColor=colorBlack,bkgndColor=colorWhite,120);
AddColumn( DateTime(), "DATE", formatDatetime, colorBlack, colorwhite);
AddColumn( c, "CLOSE",1.1,colorblack,colorwhite );

{//ROCATP COLUMNS
{for( i = 1; i < 15; i++ )
{

ROCATP=ROC(ATP+I,1);
COLORROCATP=IIf(Ref(ROCATP,-I)>0,colorGreen,colorRed);    
 VarSet("ROCATP"+I,Ref(ROCATP,-I));
  }

}

ROCATP=ROCATP;
ROCATP1=VARGET("ROCATP1");
ROCATP2=VARGET("ROCATP2");
ROCATP3=VARGET("ROCATP3");
ROCATP4=VARGET("ROCATP4");
ROCATP5=VARGET("ROCATP5");
ROCATP6=VARGET("ROCATP6");
ROCATP7=VARGET("ROCATP7");
ROCATP8=VARGET("ROCATP8");
ROCATP9=VARGET("ROCATP9");
ROCATP10=VARGET("ROCATP10");
ROCATP11=VARGET("ROCATP11");
ROCATP12=VARGET("ROCATP12");
ROCATP13=VARGET("ROCATP13");
ROCATP14=VARGET("ROCATP14");
ROCATP15=VARGET("ROCATP15");
}

{//atp columns

COLORATP1=IIf( ((ATP<Ref(ATP,-1)*1.01) AND (ATP>Ref(atp,-1)*0.99)),colorGreen,colorWhite);
AddColumn(ATP, "ATP",1.2,colorblack,colorWhite,80);

{for( i = 1; i < 8; i++ )
{
ROCATP=ROC(ATP,1);
ROCATPP2=ROC(ATP,2);
ROCATPP3=ROC(ATP,3);

colorATP1=
IIf(
(Ref(ATP,-i)<(REF(ATP,-i-1)*1.005) AND Ref(ATP,-i)>(Ref(atp,-i-1)*0.995))
AND
((REF(ATP,-1-1))<(REF(ATP,-I-2)*1.005)AND (REF(ATP,-I-1))>(REF(ATP,-i-2)*0.995))
AND
((ATP<Ref(ATP,-1)*1.01) AND (ATP>Ref(ATP,-1)*0.99))
,colorGreen,colorWhite);


AddColumn(Ref(ATP,-i), "ATP"+i  ,1.2,colorblack,colorWhite,80);

 }

}
}

{//ROCATP
ROCATP=ROC(ATP,1);
ROCATPP2=ROC(ATP,2);
ROCATPP3=ROC(ATP,3);

COLORROCATP=IIf(ROCATP>0,colorGreen,colorRed);
AddColumn(ROCATP, "ROCATP",1.2,colorROCATP,COLORWHITE,80);
}
{//ROCATP COLUMNS
{for( i = 1; i < 8; i++ )
{

ROCATP=ROC(ATP+I,1);
COLORROCATP=IIf(Ref(ROCATP,-I)>0,colorGreen,colorRed);    
AddColumn(Ref(ROCATP,-i), "ROCATP"+i  ,1.2,colorROCATP,COLORWHITE,80);

VarSet("ROCATP"+I,Ref(ROCATP,-I));
}
}

ROCATP=ROCATP;
ROCATP1=VARGET("ROCATP1");
ROCATP2=VARGET("ROCATP2");
ROCATP3=VARGET("ROCATP3");
ROCATP4=VARGET("ROCATP4");
ROCATP5=VARGET("ROCATP5");
ROCATP6=VARGET("ROCATP6");
ROCATP7=VARGET("ROCATP7");
ROCATP8=VARGET("ROCATP8");
ROCATP9=VARGET("ROCATP9");
ROCATP10=VARGET("ROCATP10");
ROCATP11=VARGET("ROCATP11");
ROCATP12=VARGET("ROCATP12");
ROCATP13=VARGET("ROCATP13");
ROCATP14=VARGET("ROCATP14");
ROCATP15=VARGET("ROCATP15");
}

/*
////////////////////////
i am not being able to count the common continous days
////////////////////
if i count the common continous days than i can filter by that too.and display that in a column too.
*/

filter=1;

i am trying my best, i know the code is not correct, but cam=n someone here guide me please.

image