n:=3;a1:=ref(h,n)=hhv(h,2*n+1); b1:=filter(a1,n); c1:=backset(b1,n+1); d1:filter(c1,n),nodraw;a2:=ref(l,n)=llv(l,2*n+1); b2:=filter(a2,n); c2:=backset(b2,n+1); d2:filter(c2,n),nodraw;e1:=(ref(llv(l,2*n),1)+ref(hhv(h,2*n),1))/2; e2:=(high+low)/2;h1:=(d1 and not((d2 and e1>=e2))) or **lastbar or barscount(close)=1;l1:=(d2 and not((d1 and e1<e2)));h2:=d1 and not((d2 and e1>=e2));x1:=ref(barslast(h1),1)+1;f1:=backset(h1 and count(l1,x1)>0,llvbars(if(l1,low,10000),x1));g1:=f1>ref(f1,1);i1:=backset(g1,2);ld:=i1>ref(i1,1);l2:=ld or **lastbar or barscount(close)=1;x2:=ref(barslast(l2),1)+1;f2:=backset(l2 and count(h2,x2)>0,hhvbars(if(h2,high,0),x2));g2:=f2>ref(f2,1);i2:=backset(g2,2);hd:=i2>ref(i2,1);drawline(ld,l,hd,h,0),colorwhite,dotline,linethick1;drawline(hd,h,ld,l,0),colorwhite,dotline,linethick1;j1:=backset(**lastbar ,min(barslast(hd),barslast(ld))+1);j2:=j1>ref(j1,1);drawline(j2,if(hd,h,l),**lastbar ,if(barslast(hd)>barslast(ld),h,l),0),colorwhite,dotline,linethick1;记得采纳哦 20210311