原文地址:缠论中枢作者:{ n1:=10;n2:=10;disp:=2; k:=if(period=5,1,{日} if(period=6,1,{周} if(period=7,1,{月} if(period=8,1,{多分钟} if(period=9,1,{多日} if(period=10,1,{季} if(period=11,2,{年} if(period=4,1,{60f} if(period=3,1,{30f} if(period=2,1,{15f} if(period=1,1{5f},1{1f}))10; p1:=peak(1,k*n1,1); p2:=peak(1,k*n1,2); wp1:=peakbars(1,k*n1,1); wp2:=peakbars(1,k*n1,2); t1:=trough(2,k*n2,1); t2:=trough(2,k*n2,2); wt1:=troughbars(2,k*n2,1); wt2:=troughbars(2,k*n2,2); tj1:=p1t1 and p2t2 ; zd:=max(t1,t2); zg:=min(p1,p2); ll:=min(t1,t2); hh:=max(p1,p2); tj2:=filter(zgzd,2); tj3:=zg=ref(zg,barslast(tj2)) or zd=ref(zd,barslast(tj2)); tj4:=tj1&&tj2&&not(tj3); tj5:=between(zd,ref(zd,ref(barslast(tj4),1)),ref(zg,ref(barslast(tj4),1; tj6:=between(zg,ref(zd,ref(barslast(tj4),1)),ref(zg,ref(barslast(tj4),1; tj7:=zgref(zg,ref(barslast(tj4),1))&&zd tj8:=tj4&&not(tj5 or tj6 or tj7); zsd:=if(tj8,zd,drawnull); zsg:=if(tj8,zg,drawnull); zsh:=if(tj8,hh,drawnull); zsl:=if(tj8,ll,drawnull); stickline(tj8,zsh,zsl,0,-1),colormagenta; stickline(tj8,zsd,zsg,if(disp=1,3,0),1),colormagenta; drawtext(disp=2,zsh, 中枢 ),colorwhite; 中枢高:ployline(disp=2,ref(zsd,barslast(tj8,circledot,colorlired; 中枢低:ployline(disp=2,ref(zsg,barslast(tj8,circledot,colorligreen; {中枢最高:ployline(disp=2,ref(zsh,barslast(tj8,pointdot,colorred; 中枢最低:ployline(disp=2,ref(zsl,barslast(tj8,pointdot,colorgreen;} 趋势高:ployline(disp=3,zig(1,k*n1)),colorliblue; 趋势低:ployline(disp=3,zig(2,k*n2)),colorliblue; 局部低点预选a:=backset(llv(l,5) 局部低点预选b:=backset(局部低点预选a=0 and ref(局部低点预选a,1)=1,2); 局部低点预选c:=if(局部低点预选b=1 and ref(局部低点预选b,1)=0,-1,0); 局部高点预选a:=backset(hhv(h,5)ref(hhv(h,4),1),4); 局部高点预选b:=backset(局部高点预选a=0 and ref(局部高点预选a,1)=1,2); 局部高点预选c:=if(局部高点预选b=1 and ref(局部高点预选b,1)=0,1,0); 缺口判断:=if(lref(h,1),1,if(h 距前高天:=barslast(局部高点预选c=1); 距前低天:=barslast(局部低点预选c=-1); 小值周期:=lowrange(l); 大值周期:=toprange(h); 低保留aa:=if(局部低点预选c=-1 and ref(距前高天,1)ref(距前低天,1) and llv(l,距前高天+1) 低保留ab:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and (距前高天=4 or llv(缺口判断,距前高天)=-1 or llv(l,距前低天+2) 低保留s:=if((低保留aa=-1 or 低保留ab=-1) and l 预判:=if((距前低天4 and hhv(缺口判断,距前低天)!=1) or ref(低保留s,距前低天)=0,1,0); 判断:=if(局部高点预选c=1 and ref(距前低天,1)=ref(距前高天,1) and 预判=1 and 大值周期ref(小值周期,距前低天+1) and 大值周期ref(小值周期,距前低天) and 大值周期ref(大值周期,距前高天),1,0); 高保留a:=if(局部高点预选c=1 and ref(距前低天,1)ref(距前高天,1) and hhv(h,距前低天+1)ref(hhv(h,距前低天+1),1),1,0); 高保留b:=if(局部高点预选c=1 and ref(距前低天,1)=ref(距前高天,1) and ref(低保留s,距前低天)=-1 and (距前低天=4 or hhv(缺口判断,距前低天)=1),1,0); 高保留:=if((高保留a=1 or 高保留b=1 or 判断=1) and href(l,距前低天+1),1,0); 预判a:=if((距前高天4 and hhv(缺口判断,距前高天)!=1) or ref(高保留,距前高天)=0,1,0); 判断a:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and 预判a=1 and 小值周期ref(大值周期,距前高天+1) and 小值周期ref(大值周期,距前高天) and 小值周期ref(小值周期,距前低天),-1,0); 低保留a:=if(局部低点预选c=-1 and ref(距前高天,1)ref(距前低天,1) and llv(l,距前高天+1) 低保留b:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and (距前高天=4 or llv(缺口判断,距前高天)=-1 or 判断a=-1),-1,0); 低保留:=if((低保留a=-1 or 低保留b=-1) and l 距前高天a:=barslast(高保留=1); 距前低天a:=barslast(低保留=-1); 预判x:=if((距前低天a4 and hhv(缺口判断,距前低天a)!=1) or ref(低保留,距前低天a)=0,1,0); 判断x:=if(局部高点预选c=1 and ref(距前低天a,1)=ref(距前高天a,1) and 预判x=1 and 大值周期ref(小值周期,距前低天a+1) and 大值周期ref(小值周期,距前低天a) and 大值周期ref(大值周期,距前高天a),1,0); 高保留xa:=if(局部高点预选c=1 and ref(距前低天a,1)ref(距前高天a,1) and hhv(h,距前低天a+1)ref(hhv(h,距前低天a+1),1),1,0); 高保留xb:=if(局部高点预选c=1 and ref(距前低天a,1)=ref(距前高天a,1) and ref(低保留,距前低天a)=-1 and (距前低天a=4 or hhv(缺口判断,距前低天a)=1),1,0); 高保留x:=if((高保留xa=1 or 高保留xb=1 or 判断x=1) and href(l,距前低天a+1),1,0); 预判xa:=if((距前高天a4 and hhv(缺口判断,距前高天a)!=1) or ref(高保留xa,距前高天a)=0,1,0); 判断xa:=if(局部低点预选c=-1 and ref(距前高天a,1)=ref(距前低天a,1) and 预判xa=1 and 小值周期ref(大值周期,距前高天a+1) and 小值周期ref(大值周期,距前高天a) and 小值周期ref(小值周期,距前低天a),-1,0); 低保留xa:=if(局部低点预选c=-1 and ref(距前高天a,1)ref(距前低天a,1) and llv(l,距前高天a+1) 低保留xb:=if(局部低点预选c=-1 and ref(距前高天a,1)=ref(距前低天a,1) and (距前高天a=4 or llv(缺口判断,距前高天a)=-1 or 判断xa=-1),-1,0); 低保留x:=if((低保留xa=-1 or 低保留xb=-1) and l 距前高天ya:=barslast(高保留x=1); 距前低天ya:=barslast(低保留x=-1); 预判yx:=if((距前低天ya4 and hhv(缺口判断,距前低天ya)!=1) or ref(低保留x,距前低天ya)=0,1,0); 判断yx:=if(局部高点预选c=1 and ref(距前低天ya,1)=ref(距前高天ya,1) and 预判yx=1 and 大值周期ref(小值周期,距前低天ya+1) and 大值周期ref(小值周期,距前低天ya) and 大值周期ref(大值周期,距前高天ya),1,0); 高保留yxa:=if(局部高点预选c=1 and ref(距前低天ya,1)ref(距前高天ya,1) and hhv(h,距前低天ya+1)ref(hhv(h,距前低天ya+1),1),1,0); 高保留yxb:=if(局部高点预选c=1 and ref(距前低天ya,1)=ref(距前高天ya,1) and ref(低保留x,距前低天ya)=-1 and (距前低天ya=4 or hhv(缺口判断,距前低天ya)=1),1,0); 高保留yx:=if((高保留yxa=1 or 高保留yxb=1 or 判断yx=1) and href(l,距前低天ya+1),1,0); 预判yxa:=if((距前高天ya4 and hhv(缺口判断,距前高天ya)!=1) or ref(高保留yxa,距前高天ya)=0,1,0); 判断yxa:=if(局部低点预选c=-1 and ref(距前高天ya,1)=ref(距前低天ya,1) and 预判yxa=1 and 小值周期ref(大值周期,距前高天ya+1) and 小值周期ref(大值周期,距前高天ya) and 小值周期ref(小值周期,距前低天ya),-1,0); 低保留yxa:=if(局部低点预选c=-1 and ref(距前高天ya,1)ref(距前低天ya,1) and llv(l,距前高天ya+1) 低保留yxb:=if(局部低点预选c=-1 and ref(距前高天ya,1)=ref(距前低天ya,1) and (距前高天ya=4 or llv(缺口判断,距前高天ya)=-1 or 判断yxa=-1),-1,0); 低保留yx:=if((低保留yxa=-1 or 低保留yxb=-1) and l aaad:=if(高保留yx=1 and 低保留yx=-1 and href(h,ref(距前高天ya,1)+2),1,if(高保留yx=1 and 低保留yx=-1 and l 极点保留:=if(aaad=0,高保留yx+低保留yx,aaad); 局部极点:if(极点保留=-1,l,if(极点保留=1,h,drawnull)) circledot coloryellow; drawline(极点保留=-1,局部极点,极点保留=1,局部极点,0)colorlired; drawline(极点保留=1,局部极点,极点保留=-1,局部极点,0)coloryellow; dd1:=barslast(abs(极点保留)!=1);{ drawtext(极点保留=1,局部极点, 卖 ),colorgreen; drawtext(极点保留=-1,局部极点, 买 ),colorred;}; vara1:=ref(h,60)=hhv(h,121); varb1:=filter(vara1,60); varc1:=backset(varb1,61); varhd:=filter(varc1,60); varqgc:=ref(h,barslast(varhd)); vartp:=cross(c,varqgc); varqgts:=barslast(varhd); vartpts:=barslast(vartp); varqgtpyes:=vartpts varqgtpts:=if(varqgtpyes,vartpts,drawnull),nodraw; varqgzf:=(cvarqgc-1)*100,nodraw;  突破天数:varqgtpts,color9932cd,nodraw; 突破涨幅:varqgzf,color9932cd,nodraw; n:=75;p:=5;pp1:=10;{n为多少天内的高低值参数,我以自已的初始k线根数定义.p1,p2为短,长支撑压力取点参数} a1:=ref(h,p)=hhv(h,2*p+1); b1:=filter(a1,p); c1:=backset(b1,p+1); d1:=filter(c1,p); e1:=backset(islastbar,barslast(d1)+1); f1:=e1ref(e1,1); 短压:drawline(d1,h,f1,h,1),colorcyan; a2:=ref(l,p)=llv(l,2*p+1); b2:=filter(a2,p); c2:=backset(b2,p+1); d2:=filter(c2,p); e2:=backset(islastbar,barslast(d2)+1); f2:=e2ref(e2,1); 短支:drawline(d2,l,f2,l,1),colorlired; aa1:=ref(h,p)=hhv(h,2*pp1+1); bb1:=filter(aa1,pp1); cc1:=backset(bb1,pp1+1); ddd1:=filter(cc1,pp1); ee1:=backset(islastbar,barslast(dd1)+1); ff1:=ee1ref(ee1,1); 长压:drawline(ddd1,h,ff1,h,1),colorgreen; aa2:=ref(l,pp1)=llv(l,2*pp1+1); bb2:=filter(aa2,pp1); cc2:=backset(bb2,pp1+1); dd2:=filter(cc2,pp1); ee2:=backset(islastbar,barslast(dd2)+1); ff2:=ee2ref(ee2,1); 长支:drawline(dd2,l,ff2,l,1),colorred; stickline(c=o,c,o,3,0),color000045; stickline(c=o,c,o,2.5,0),color000065; stickline(c=o,c,o,2,0),color000085; stickline(c=o,c,o,1.5,0),color0000a5; stickline(c=o,c,o,1,0),color0000c5; stickline(c=o,c,o,0.5,0),color0000e5; stickline(c=o,h,l,0,0),color0000f5; stickline(c stickline(c stickline(c stickline(c stickline(c stickline(c stickline(c 高:=refdate(hhv(h,n),date); 低:=refdate(llv(l,n),date); h1:=高-(高-低)*0.191; h2:=高-(高-低)*0.382; h3:=高-(高-低)*0.5; h4:=高-(高-低)*0.618; h5:=高-(高-低)*0.809; drawtext(currbarscount=1,高, 高 ),colorgreen; drawtext(currbarscount=1,h1, 809 ),colorcyan; drawtext(currbarscount=1,h2, 618 ),colorgray; drawtext(currbarscount=1,h3, 中 ),coloryellow; drawtext(currbarscount=1,h4, 382 ),colorlired; drawtext(currbarscount=1,h5, 191 ),colormagenta; drawtext(currbarscount=1,低, 低 ),colorred; stickline(currbarscount=13,高,高,100,-1),colorgreen; stickline(currbarscount=13,h1,h1,100,-1),colorcyan; stickline(currbarscount=13,h2,h2,100,-1),colorgray; stickline(currbarscount=13,h3,h3,100,-1),coloryellow; stickline(currbarscount=13,h4,h4,100,-1),colorlired; stickline(currbarscount=13,h5,h5,100,-1),colormagenta; stickline(currbarscount=13,低,低,100,-1),colorred;