(input: n(5,1,100);
drawgbklast(close>0,strip(rgb(95,95,95),rgb(0,0,0),0));
a1:=ref(h,n)=hhv(h,2*n+1);
b1:=filter(a1,n);
c1:=backset(b1,n+1);
d1:=filter(c1,n);{高點}
a2:=ref(l,n)=llv(l,2*n+1);
b2:=filter(a2,n);
c2:=backset(b2,n+1);
d2:=filter(c2,n);{低點}
e1:=(ref(llv(l,2*n),1)+ref(hhv(h,2*n),1))/2; e2:=(h+l)/2;{高低點出現(xiàn)在同一k線上時可作取舍}
h1:=(d1 and not(d2 and e1>=e2)) or barstatus=2 or barscount(c)=1;
l1:=(d2 and not(d1 and e1<e2));
x1:=ref(barslast(h1),1)+1; f1:=backset(h1 and count(l1,x1)>0,llvbars
(if(l1,l,10000),x1));
g1:=f1>ref(f1,1); i1:=backset(g1,2); ld:=i1>ref(i1,1);{過濾后低點}
l2:=ld or barstatus=2 or barscount(c)=1;
x2:=ref(barslast(l2),1)+1; f2:=backset(l2 and count(h2,x2)>0,hhvbars
(if(h2,h,0),x2));
g2:=f2>ref(f2,1); i2:=backset(g2,2); hd:=i2>ref(i2,1);{過濾后高點}
r1:=backset(barstatus=2,barslast(hd)+1); s1:=r1>ref(r1,1); {前一高}
t1:=backset(barstatus=2,barslast(ld)+1); u1:=t1>ref(t1,1); {前一低}
r2:=backset(s1,ref(barslast(hd),1)+2); s2:=r2>ref(r2,1); {前二高}
t2:=backset(u1,ref(barslast(ld),1)+2); u2:=t2>ref(t2,1); {前二低}
t3:=backset(u2,ref(barslast(ld),1)+2); u3:=t3>ref(t3,1); {前三低}
t4:=backset(u3,ref(barslast(ld),1)+2); u4:=t4>ref(t4,1); {前四低}
r3:=backset(s2,ref(barslast(hd),1)+2); s3:=r3>ref(r3,1); {前三高}
r4:=backset(s3,ref(barslast(hd),1)+2); s4:=r4>ref(r4,1); {前四高}
短期壓力:drawline(s2,h,s1,h,1),colorred;
短期支撐:drawline(u2,l,u1,l,1),colorgreen;
中期壓力:drawline(s3,h,s2,h,1),coloryellow;
中期支撐:drawline(u3,l,u2,l,0),colorgreen;
長期壓力:drawline(s4,h,s3,h,1),colorwhite;
長期支撐:drawline(u4,l,u3,l,0),colorgreen;
drawicon(s1,h*1.01,10);
drawicon(s2,h*1.01,10);
drawicon(s3,h*1.01,10);
drawicon(s4,h*1.01,10);
drawicon(u1,l*0.99,9);
drawicon(u2,l*0.99,9);
drawicon(u3,l*0.99,9);
drawicon(u4,l*0.99,9);
聯(lián)系客服