RC1:=REF(C,1);
AA:=REF(H,8)=HHV(H,2*8+1);
AA1:=REF(L,8)=LLV(L,2*8+1);
QY:=BACKSET(AA,8+1);
QY1:=BACKSET(AA1,8+1);
CC2:=FILTER(QY,8) AND H=HHV(H,8+1);
CC1:=FILTER(QY1,8) AND L=LLV(L,8+1);
DDD:=BARSLAST(CC2);
DD1:=BARSLAST(CC1);
CURRBARSCOUNT:=DATACOUNT-BARPOS+1;
GDTS:=IF(CC2,CURRBARSCOUNT,0);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=REFX1(DINGBUTS,10000);
DDCS1:=REFX1(DDTS1,10000);
GDCS13:=REFX1(REF(H,GDCS1-1),10000);
DDCS13:=REFX1(REF(L,DDCS1-1),10000);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=REFX1(DINGBUTS1,10000);
DDCS2:=REFX1(DDTS2,10000);
GDCS23:=REFX1(REF(H,DINGBUTS1-1),10000);
DDCS23:=REFX1(REF(L,DDTS2-1),10000);
XG1:=BACKSET(ISLASTBAR,GDCS1);
XD1:=BACKSET(ISLASTBAR,DDCS1);
XG2:=BACKSET(ISLASTBAR,DINGBUTS1);
XD2:=BACKSET(ISLASTBAR,DDTS2);
M:=4;
AAA:=REF(H,M)=HHV(H,2*M+1);