原文地址:[通达信] 缠论局部低点作者:好过些博主{ 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))&&zdref(zd,ref(barslast(tj4),1)); 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); 中枢高:=ployline(disp=2,ref(zsd,barslast(tj8; 中枢低:=ployline(disp=2,ref(zsg,barslast(tj8; 中枢最高:=ployline(disp=2,ref(zsh,barslast(tj8; 中枢最低:=ployline(disp=2,ref(zsl,barslast(tj8; 趋势高:=ployline(disp=3,zig(1,k*n1)); 趋势低:=ployline(disp=3,zig(2,k*n2)); 局部低点预选a:=backset(llv(l,5)ref(llv(l,4),1),4); 局部低点预选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(href(l,1),-1,0)); 距前高天:=barslast(局部高点预选c=1); 距前低天:=barslast(局部低点预选c=-1); 小值周期:=lowrange(l); 大值周期:=toprange(h); 低保留aa:=if(局部低点预选c=-1 and ref(距前高天,1)ref(距前低天,1) and llv(l,距前高天+1)ref(llv(l,距前高天+1),1),-1,0); 低保留ab:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and (距前高天=4 or llv(缺口判断,距前高天)=-1 or llv(l,距前低天+2)ref(llv(l,距前低天+1),1)),-1,0); 低保留s:=if((低保留aa=-1 or 低保留ab=-1) and lref(h,距前高天+1),-1,0); 预判:=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)ref(llv(l,距前高天+1),1),-1,0); 低保留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 lref(h,距前高天+1),-1,0); 距前高天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)ref(llv(l,距前高天a+1),1),-1,0); 低保留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 lref(h,距前高天a+1),-1,0); 距前高天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)ref(llv(l,距前高天ya+1),1),-1,0); 低保留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 lref(h,距前高天ya+1),-1,0); aaad:=if(高保留yx=1 and 低保留yx=-1 and href(h,ref(距前高天ya,1)+2),1,if(高保留yx=1 and 低保留yx=-1 and lref(l,ref(距前低天ya,1)+2),-1,0)); 极点保留:=if(aaad=0,高保留yx+低保留yx,aaad); 局部极点:极点保留=-1; {缠论分型分笔主图} 顶:=bbi+3*std(bbi,13),color004aff; 底:=bbi-3*std(bbi,13),color67ff00; drawband(bbi,rgb(97,95,00),顶,rgb(97,95,00)); drawband(bbi,rgb(25,75,150),底,rgb(25,75,250)); {   } ku1:=if(high=hhv(high,3),1,0); kd1:=if(low=llv(low,3),1,0); ul:=if(ref(ku1,2)=1 and ref(ku1,1)=0 and ku1=0,ref(high,2),ref(high,2+barslast(ref(ku1,2)=1 and ref(ku1,1)=0 and ku1=0; dl:=if(ref(kd1,2)=1 and ref(kd1,1)=0 and kd1=0,ref(low,2),ref(low,2+barslast(ref(kd1,2)=1 and ref(kd1,1)=0 and kd1=0; hv:=hul and href(h,1) ; lv:=ldl and lref(l,1) ; gp:=barslast(hv); dp:=barslast(lv); ip:=if(gp=0,dp,gp)3; hhv1:=hv and ip and h=hhv(h,barslast(lv)); lv1:=lv and ip and l=llv(l,barslast(hv)); drawline(lv1,low,hhv1, high,0),coloryellow,linethick2; drawline(hhv1,high,lv1, low,0),colormagenta,linethick2; stickline(close ref(close,1) ,high,low,0,1 ),colorred; stickline(close ref(close,1) ,open,close,3,0 ),color000055; stickline(close ref(close,1) ,open,close,2.7,0 ),color000077; stickline(close ref(close,1) ,open,close,2.1,0 ),color000099; stickline(close ref(close,1) ,open,close,1.5,0 ),color0000bb; stickline(close ref(close,1) ,open,close,0.9,0 ),color0000dd; stickline(close ref(close,1) ,open,close,0.3,0 ),color0000ff; stickline(close= ref(close,1) ,high,low,0,1 ),colorwhite; stickline(close= ref(close,1) ,open,close,3,0 ),color; stickline(close= ref(close,1) ,open,close,2.7,0 ),color; stickline(close= ref(close,1) ,open,close,2.1,0 ),color; stickline(close= ref(close,1) ,open,close,1.5,0 ),colorbbbbbb; stickline(close= ref(close,1) ,open,close,0.9,0 ),colordddddd; stickline(close= ref(close,1) ,open,close,0.3,0 ),colorffffff; stickline(close ref(close,1) ,high,low,0,1 ),colorcyan; stickline(close ref(close,1) ,open,close,3,0 ),color; stickline(close ref(close,1) ,open,close,2.7,0 ),colorcc0000; stickline(close ref(close,1) ,open,close,2.1,0 ),colorff4400; stickline(close ref(close,1) ,open,close,1.5,0 ),colorff8800; stickline(close ref(close,1) ,open,close,0.9,0 ),colorffcc00; stickline(close ref(close,1) ,open,close,0.3,0 ),colorcyan; {笔底分型 选股 预警 确保向下笔成立后的底分型} v00:= highref(high,1) and lowref(low,1); v01:= highref(high,1) and lowref(low,1); v02:= highref(high,1) and lowref(low,1); v03:= highref(high,1) and lowref(low,1); v04:= ref(high,2)  high and ref(low,2)  low and ref(high,2)  ref(high,1) and ref(low,2)  ref(low,1); v1:= count(v00,6)=3 and count(v01 or v02,5)=0 and llvbars(low,6) = 1 and hhvbars(high,6) = 5 and v03; v2:= count(v00,7)=3 and count(v01 or v02,6)=1 and llvbars(low,7) = 2 and hhvbars(high,7) = 6 and v04; v3:= count(v00,7)=3 and count(v01 or v02,6)=1 and llvbars(low,7) = 1 and hhvbars(high,7) = 6 and v03; v4:= count(v00,8)=3 and count(v01 or v02,7)=2 and llvbars(low,8) = 2 and hhvbars(high,8) = 7 and v04; v5:= count(v00,8)=3 and count(v01 or v02,7)=2 and llvbars(low,8) = 1 and hhvbars(high,8) = 7 and v03; v6:= count(v00,9)=3 and count(v01 or v02,8)=3 and llvbars(low,9) = 2 and hhvbars(high,9) = 8 and v04; v7:= count(v00,9)=3 and count(v01 or v02,8)=3 and llvbars(low,9) = 1 and hhvbars(high,9) = 8 and v03; v8:= count(v00,10)=3 and count(v01 or v02,9)=4 and llvbars(low,10) = 2 and hhvbars(high,10) = 9 and v04; v9:= count(v00,10)=3 and count(v01 or v02,9)=4 and llvbars(low,10) = 1 and hhvbars(high,10) = 9 and v03; v10:= count(v00,11)=3 and count(v01 or v02,10)=5 and llvbars(low,11) = 2 and hhvbars(high,11) = 10 and v04; xg:= v1 or v2 or v3 or v4 or v5 or v6 or v7 or v8 or v9 or v10; drawicon(filter(xg=1,5),l*0.97,1); {笔顶分型 选股 预警 确保向上笔成立后的顶分型} hv00:= highref(high,1) and lowref(low,1); hv01:= highref(high,1) and lowref(low,1); hv02:= highref(high,1) and lowref(low,1); hv03:= highref(high,1) and lowref(low,1); hv04:= ref(high,2)  high and ref(low,2)  low and ref(high,2)  ref(high,1) and ref(low,2)  ref(low,1); hv1:= count(hv00,6)=3 and count(hv01 or hv02,5)=0 and hhvbars(high,6) = 1 and llvbars(low,6) = 5 and hv03; hv2:= count(hv00,7)=3 and count(hv01 or hv02,6)=1 and hhvbars(high,7) = 2 and llvbars(low,7) = 6 and hv04; hv3:= count(hv00,7)=3 and count(hv01 or hv02,6)=1 and hhvbars(high,7) = 1 and llvbars(low,7) = 6 and hv03; hv4:= count(hv00,8)=3 and count(hv01 or hv02,7)=2 and hhvbars(high,8) = 2 and llvbars(low,8) = 7 and hv04; hv5:= count(hv00,8)=3 and count(hv01 or hv02,7)=2 and hhvbars(high,8) = 1 and llvbars(low,8) = 7 and hv03; hv6:= count(hv00,9)=3 and count(hv01 or hv02,8)=3 and hhvbars(high,9) = 2 and llvbars(low,9) = 8 and hv04; hv7:= count(hv00,9)=3 and count(hv01 or hv02,8)=3 and hhvbars(high,9) = 1 and llvbars(low,9) = 8 and hv03; hv8:= count(hv00,10)=3 and count(hv01 or hv02,9)=4 and hhvbars(high,10) = 2 and llvbars(low,10) = 9 and hv04; hv9:= count(hv00,10)=3 and count(hv01 or hv02,9)=4 and hhvbars(high,10) = 1 and llvbars(low,10) = 9 and hv03; hv10:= count(hv00,11)=3 and count(hv01 or hv02,10)=5 and hhvbars(high,11) = 2 and llvbars(low,11) = 10 and hv04; hxg:=hv1 or hv2 or hv3 or hv4 or hv5 or hv6 or hv7 or hv8 or hv9 or hv10; drawicon(filter(hxg=1,3),h*1.01,2); 缠论板块强弱指标公式_通用版         tmp1:=if(cma5,1,0); tmp2:=if(cma13,1,0); tmp3:=if(cma21,1,0); tmp4:=if(cma34,1,0); tmp5:=if(cma55,1,0); tmp6:=if(cma89,1,0); tmp7:=if(cma144,1,0); tmp8:=if(cma233,1,0); 类别:tmp1+tmp2+tmp3+tmp4+tmp5+tmp6+tmp7+tmp8+1,linethick0; {悟多版缠论} { 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))&&zdref(zd,ref(barslast(tj4),1)); 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, 中枢 ),colorred; 中枢高:ployline(disp=2,ref(zsd,barslast(tj8,crossdot,colorlired; 中枢低:ployline(disp=2,ref(zsg,barslast(tj8,crossdot,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)ref(llv(l,4),1),4); 局部低点预选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(href(l,1),-1,0)); 距前高天:=barslast(局部高点预选c=1); 距前低天:=barslast(局部低点预选c=-1); 小值周期:=lowrange(l); 大值周期:=toprange(h); 低保留aa:=if(局部低点预选c=-1 and ref(距前高天,1)ref(距前低天,1) and llv(l,距前高天+1)ref(llv(l,距前高天+1),1),-1,0); 低保留ab:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and (距前高天=4 or llv(缺口判断,距前高天)=-1 or llv(l,距前低天+2)ref(llv(l,距前低天+1),1)),-1,0); 低保留s:=if((低保留aa=-1 or 低保留ab=-1) and lref(h,距前高天+1),-1,0); 预判:=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)ref(llv(l,距前高天+1),1),-1,0); 低保留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 lref(h,距前高天+1),-1,0); 距前高天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)ref(llv(l,距前高天a+1),1),-1,0); 低保留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 lref(h,距前高天a+1),-1,0); 距前高天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)ref(llv(l,距前高天ya+1),1),-1,0); 低保留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 lref(h,距前高天ya+1),-1,0); aaad:=if(高保留yx=1 and 低保留yx=-1 and href(h,ref(距前高天ya,1)+2),1,if(高保留yx=1 and 低保留yx=-1 and lref(l,ref(距前低天ya,1)+2),-1,0)); 极点保留:=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;  {笔底分型__ 确保向下笔成立后的底分型} 重心线:(h+l+o+c*3)6; nx:=(3*close+low+open+high)6; 牛线:=(20*nx+19*ref(nx,1)+18*ref(nx,2)+17*ref(nx,3)+16*ref(nx,4) +15*ref(nx,5)+14*ref(nx,6)+13*ref(nx,7)+12*ref(nx,8)+11*ref(nx,9) +10*ref(nx,10)+9*ref(nx,11)+8*ref(nx,12)+7*ref(nx,13)+6*ref(nx,14) +5*ref(nx,15)+4*ref(nx,16)+3*ref(nx,17) +2*ref(nx,18)+ref(nx,20))210; 牛熊线:ma(牛线,6),colorgreen,linethick2; 简底:=href(h,1) and ref(h,1)ref(h,2) and lref(l,1) and ref(l,1)ref(l,2); 简顶:=href(h,1) and ref(h,1)ref(h,2) and lref(l,1) and ref(l,1)ref(l,2); 包含1:=ref(h,1)=ref(h,2) and ref(l,1)=ref(l,2); 包含2:=ref(h,1)=ref(h,2) and ref(l,1)=ref(l,2); 包底1:=href(h,2) and ref(h,2)ref(h,3) and lref(l,1) and ref(l,1)ref(l,3); 包底2:=href(h,1) and ref(h,1)ref(h,3) and lref(l,2) and ref(l,2)ref(l,3); 包顶1:=href(h,1) and ref(h,1)ref(h,3) and lref(l,2) and ref(l,2)ref(l,3); 包顶2:=href(h,2) and ref(h,2)ref(h,3) and lref(l,1) and ref(l,1)ref(l,3); 复底:=if(包含1,包底1,if(包含2,包底2,简底)); 复顶:=if(包含1,包顶1,if(包含2,包顶2,简顶)); 底分型:=if(barslast(cross(牛熊线,重心线))3,filter(backset(filter(复底 and 重心线牛熊线,3),2),1),0); 顶分型:=if(barslast(cross(重心线,牛熊线))3,filter(backset(filter(复顶 and 重心线牛熊线,3),2),1),0); stickline(底分型,c,o,8,0),colorff00ff,linethick2; stickline(底分型,c,o,3,0),colorff00ff,linethick2; stickline(底分型,h,l,1,0),colorff00ff,linethick2; stickline(顶分型,c,o,8,0),coloryellow,linethick2; stickline(顶分型,c,o,3,0),coloryellow,linethick2; stickline(顶分型,h,l,1,0),coloryellow,linethick2; drawtext(底分型,l*0.99, 底型 ),coloryellow,linethick1; drawtext(顶分型,h*1.02, 顶型 ),coloryellow,linethick1; {nczs 4.0_缠中说禅走势} {名称:nczs 4.0} {描述:缠中说禅走势} {功能:图解市场一二三类买卖点} {设计:股市肉鸡} {版本:4.00} {日期:2010.02.22} {参数:short 5307 long 1025019} t:=period; d:=if(t=0,30,if(t=1,25,if(t=8,25,if(t=2,20,if(t=3,20,if(t=4,20,if(t=5,10,if(t=6,10,if(t=7,10,if(t=9,10,if(t=10,10,10)); rma:=ema(close,short); nma:=ema(close,long); (l=llv(l,barslast(cross(nma,rma))+1) and l=llv(l,d) and rma=nma,l,h=hhv(h,barslast(cross(rma,nma))+1) and h=hhv(h,d) and rma=nma,h,0),colorwhite; (h=hhv(h,barslast(cross(rma,nma))+1) and h=hhv(h,d) and rma=nma,h,l=llv(l,barslast(cross(nma,rma))+1) and l=llv(l,d) and rma=nma,l,0),colorwhite; {布林+顶底线段} 布林中线:ma(close,21); 布林上线:布林中线+2*std(close,21) colorgreen; 布林下线:布林中线-2*std(close,21) colorred; 局部低点预选a:=backset(llv(l,5)ref(llv(l,4),1),4); 局部低点预选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); 局部极点a:=局部低点预选c+局部高点预选c;  circledot coloryellow; 缺口判断:=if(lref(h,1),1,if(href(l,1),-1,0)); 距前高天:=barslast(局部高点预选c=1); 距前低天:=barslast(局部低点预选c=-1); 小值周期:=lowrange(l); 大值周期:=toprange(h); 低保留aa:=if(局部低点预选c=-1 and ref(距前高天,1)ref(距前低天,1) and llv(l,距前高天+1)ref(llv(l,距前高天+1),1),-1,0); 低保留ab:=if(局部低点预选c=-1 and ref(距前高天,1)=ref(距前低天,1) and (距前高天=4 or llv(缺口判断,距前高天)=-1 or llv(l,距前低天+2)ref(llv(l,距前低天+1),1)),-1,0); 低保留s:=if((低保留aa=-1 or 低保留ab=-1) and lref(h,距前高天+1),-1,0); 预判:=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)ref(llv(l,距前高天+1),1),-1,0); 低保留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 lref(h,距前高天+1),-1,0); aaad:=if(高保留=1 and 低保留=-1 and href(h,ref(距前高天,1)+2),1,if(高保留=1 and 低保留=-1 and lref(l,ref(距前低天,1)+2),-1,0)); 极点保留:=if(aaad=0,高保留+低保留,aaad); 局部极点:=if(极点保留=-1,l,if(极点保留=1,h,drawnull)) circledot coloryellow; drawline(极点保留=-1,局部极点,极点保留=1,局部极点,0)colorblue; drawline(极点保留=1,局部极点,极点保留=-1,局部极点,0)colorblue; 缠论公式_飞狐解盘指标_"每日走势分类" {走势分类--引用指标} 先建一个被引用指标  走势分类 {走势分类--引用指标} 开盘:=barslast(dateref(date,1))+1,linethick; h1:=ref(h,1),linethick;l1:=ref(l,1),linethick; h2:=ref(h,2),linethick;l2:=ref(l,2),linethick; z0:=h1h2 and l1l2 and h1=l2;{下跌} z1:=h1=h2 and l1=l2;{小包含} z2:=h1=h2 and l1=l2;{大包含} z3:=h1h2 and l1l2 and l1=h2;{上涨} hh:=if(z3,h2,if(z2,h2,if(z1,h1,if(z0,h1,0)colorred;{昨天区间高} ll:=if(z3,l1,if(z2,l2,if(z1,l1,if(z0,l2,0)colorgreen;{昨天区间底} zz0:=hhh and lll and h=ll;{下跌} zz1:=h=hh and l=ll;{小包含} zz2:=h=hh and l=ll;{大包含} zz3:=hhh and lll and l=hh;{上涨} hhh:if(zz3,hh,if(zz2,hh,if(zz1,h,if(zz0,h,0)colorred,linethick;;{3天区间高} lll:if(zz3,l,if(zz2,ll,if(zz1,l,if(zz0,ll,0)colorgreen,linethick;;{3天区间底} t3:=开盘=3 and hhh0;{开盘前3根k线有中枢} t4:=开盘=4 and hhh0 and last(not(t3),4,0);{开盘第4根k线才有中枢} t5:=开盘=5 and hhh0 and last(not(t3 or t4),5,0);{开盘第5根k线才有中枢} t6:=开盘=6 and hhh0 and last(not(t3 or t4 or t5),6,0);{开盘第6根k线才有中枢} t7:=开盘=7 and hhh0 and last(not(t3 or t4 or t5 or t6),7,0);{开盘第7根k线才有中枢} t8:=开盘=8 and hhh0 and last(not(t3 or t4 or t5 or t6 or t7),8,0);{开盘第8根k线才有中枢} 全天无中枢:开盘=8 and hhh=0 and last(not(t3 or t4 or t5 or t6 or t7),8,0); q7h:=开盘=7 and hhh0 and ref(hhh,4)0 and (lllref(hhh,4)or hhhref(lll,4)); q8h:=开盘=8 and hhh0 and ref(hhh,1)=0 and ref(hhh,5)0 and (lllref(hhh,5)or hhhref(lll,5)); t7h:=ref(hhh,4)=0 and 开盘=7 and hhh0 and ref(hhh,3)0 and (lllref(hhh,3)or hhhref(lll,3)); t8h:=ref(hhh,5)=0 and 开盘=8 and hhh0 and ref(hhh,1)=0 and ref(hhh,4)0 and (lllref(hhh,4)or hhhref(lll,4)); 中枢数量:sum(t3+t4+t5+t6+t7+t8+q7h+q8h+t7h+t8h,开盘); 第一中枢高:sum(if(t3,hhh,if(t4,hhh,if(t5,hhh,if(t6,hhh,if(t7,hhh,if(t8,hhh,0,开盘); 第一中枢底:sum(if(t3,lll,if(t4,lll,if(t5,lll,if(t6,lll,if(t7,lll,if(t8,lll,0,开盘); 第二中枢高:sum(if(q7h,hhh,if(q8h,hhh,if(t7h,hhh,if(t8h,hhh,0),开盘); 第二中枢底:sum(if(q7h,lll,if(q8h,lll,if(t7h,lll,if(t8h,lll,0),开盘); 第四k高:sum(if(开盘=4,h,0),开盘); 第四k底:sum(if(开盘=4,l,0),开盘); 第五k高:sum(if(开盘=5,h,0),开盘); 第五k底:sum(if(开盘=5,l,0),开盘); 前三k高:sum(if(开盘=3,max(h,max(h1,h2)) ,0),开盘); 前三k底:sum(if(开盘=3,min(l,min(l1,l2)) ,0),开盘); 第八k高:sum(if(开盘=8,h ,0),开盘); 第八k底:sum(if(开盘=8,l ,0),开盘);  主公式  可放在自己喜欢的主图指标后面(方便使用)........ {每日走势分类} explain(1=1, +stkname+ ),coloryellow; 中枢数量:=stkindi( , 走势分类.中枢数量 ,0,4); 第一中枢高:=stkindi( , 走势分类.第一中枢高 ,0,4); 第一中枢底:=stkindi( , 走势分类.第一中枢底 ,0,4); 第二中枢高:=stkindi( , 走势分类.第二中枢高 ,0,4); 第二中枢底:=stkindi( , 走势分类.第二中枢底 ,0,4); 第四k高:=stkindi( , 走势分类.第四k高 ,0,4); 第四k底:=stkindi( , 走势分类.第四k底 ,0,4); 第五k高:=stkindi( , 走势分类.第五k高 ,0,4); 第五k底:=stkindi( , 走势分类.第五k底 ,0,4); 前三k高:=stkindi( , 走势分类.前三k高 ,0,4); 前三k底:=stkindi( , 走势分类.前三k底 ,0,4); 第八k高:=stkindi( , 走势分类.第八k高 ,0,4); 第八k底:=stkindi( , 走势分类.第八k底 ,0,4); 升:=第二中枢底第一中枢高 and 中枢数量=2; 跌:=第二中枢高第一中枢底 and 中枢数量=2; 单边区间高1:=if(升 ,第二中枢底,0); 单边区间高2:=if(跌 ,第一中枢底,0); 单边区间高:=if(中枢数量=2 and 升,第二中枢底,第一中枢底); 单边区间底1:=if(升 and 中枢数量=2,第一中枢高,0); 单边区间底2:=if(跌 and 中枢数量=2,第二中枢高,0); 单边区间底:=if(中枢数量=2 and 升,第一中枢高,第二中枢高); 区间市1:=中枢数量=2 and c=第二中枢高; 区间市2:=中枢数量=2 and between(c,第二中枢底,第二中枢高); 区间市3:=中枢数量=2 and c=第二中枢底; tt1:=中枢数量=2 and 第八k高单边区间底;{没有穿越} tt2:=中枢数量=2 and (between(第八k底,单边区间底,单边区间高) or between(第八k高,单边区间底,单边区间高)); tt3:=中枢数量=2 and 第八k底单边区间高 ; explain(区间市1, 收盘高于第2中枢高点 ),colorred;红 explain(区间市2, 收盘介于第2中枢之间 ),colorwhite;白 explain(区间市3, 收盘低于第2中枢低点 ),colorcyan;青 explain(tt2, 最后一根k线穿越单边区间 ),colorred;红 explain(tt3, 最后一根k线完全在单边区间上方,没有穿越单边区间 ),colorwhite;白 explain(tt1, 最后一根k线完全在单边区间下方,没有穿越单边区间 ),colorcyan;青 弱平衡市1:=中枢数量=1 and (前三k高=h ) and c=(第一中枢高+h)2; 弱平衡市2:=中枢数量=1 and (前三k高=h ) and between(c,(第一中枢高+h)2,第一中枢高); 弱平衡市3:=中枢数量=1 and (前三k高=h ) and between(c,第一中枢底,第一中枢高); 弱平衡市4:=中枢数量=1 and (前三k高=h ) and between(c,(第一中枢底+l)2,第一中枢底); 弱平衡市5:=中枢数量=1 and (前三k高=h ) and c=(第一中枢底+l)2; 强平衡市1:=中枢数量=1 and 前三k底=l and c=(第一中枢高+h)2; 强平衡市2:=中枢数量=1 and 前三k底=l and between(c,(第一中枢高+h)2,第一中枢高); 强平衡市3:=中枢数量=1 and 前三k底=l and between(c,第一中枢高,第一中枢底); 强平衡市4:=中枢数量=1 and 前三k底=l and between(c,(第一中枢底+l)2,第一中枢底); 强平衡市5:=中枢数量=1 and 前三k底=l and c=(第一中枢底+l)2; 转折平衡市1:=中枢数量=1 and (前三k底l and 前三k高h) and c=(第一中枢高+h)2; 转折平衡市2:=中枢数量=1 and (前三k底l and 前三k高h) and between(c,(第一中枢高+h)2,第一中枢高); 转折平衡市3:=中枢数量=1 and (前三k底l and 前三k高h) and between(c,第一中枢高,第一中枢底); 转折平衡市4:=中枢数量=1 and (前三k底l and 前三k高h) and between(c,(第一中枢底+l)2,第一中枢底); 转折平衡市5:=中枢数量=1 and (前三k底l and 前三k高h) and c=(第一中枢底+l)2; explain(弱平衡市1, 今天的走势为弱平衡市,类型为强1级 n收盘价高于中枢高点,而且收盘价近乎全天最高价 ),colorred;红 explain(弱平衡市2, 今天的走势为弱平衡市,类型为强2级 n收盘价介于中枢高点和最高价之间一半 ),colorff7bff;粉 explain(弱平衡市3, 今天的走势为弱平衡市,类型为强3级 n收盘价介于中枢区间内 ),colorwhite;白 explain(弱平衡市4, 今天的走势为弱平衡市,类型为强4级 n收盘价介于中枢低点和最低价之间一半 ),colorcyan;青 explain(弱平衡市5, 今天的走势为弱平衡市,类型为强5级 n收盘价低于中枢低点,而且收盘价近乎全天最低价, ),colorff7b00;蓝 explain(强平衡市1, 今天的走势为强平衡市,类型为强1级 n收盘价高于中枢高点,而且收盘价近乎全天最高价 ),colorred;红 explain(强平衡市2, 今天的走势为强平衡市,类型为强2级 n收盘价介于中枢高点和最高价之间一半 ),colorff7bff;粉 explain(强平衡市3, 今天的走势为强平衡市,类型为强3级 n收盘价介于中枢区间内 ),colorwhite;白 explain(强平衡市4, 今天的走势为强平衡市,类型为强4级 n收盘价介于中枢低点和最低价之间一半 ),colorcyan;青 explain(强平衡市5, 今天的走势为强平衡市,类型为强5级 n收盘价低于中枢低点,而且收盘价近乎全天最低价, ),colorff7b00;蓝 explain(转折平衡市1, 今天的走势为转折平衡市,类型为强1级 n收盘价高于中枢高点,而且收盘价近乎全天最高价 ),colorred;红 explain(转折平衡市2, 今天的走势为转折平衡市,类型为强2级 n收盘价介于中枢高点和最高价之间一半 ),colorff7bff;粉 explain(转折平衡市3, 今天的走势为转折平衡市,类型为强3级 n收盘价介于中枢区间内 ),colorwhite;白 explain(转折平衡市4, 今天的走势为转折平衡市,类型为强4级 n收盘价介于中枢低点和最低价之间一半 ),colorcyan;青 explain(转折平衡市5, 今天的走势为转折平衡市,类型为强5级 n收盘价低于中枢低点,而且收盘价近乎全天最低价, ),colorff7b00;蓝 explain(升, 今天有2个中枢,并且属于中枢上升状态 ),colorred;红 explain(跌, 今天有2个中枢,并且属于中枢下跌状态 ),colorcyan;青 explain(跌,  ),colorff7b00;蓝 explainex(c, 中枢数量 : ,中枢数量,0,0); explain(跌,  ),colorcyan; explainex(c, 第一中枢底 : ,第一中枢底,2,0); explainex(c, 第一中枢高 : ,第一中枢高,2,1); explainex(中枢数量=2, 第二中枢底 : ,第二中枢底,2,0); explainex(中枢数量=2, 第二中枢高 : ,第二中枢高,2,1); explainex(中枢数量=2, 单边区间底 : ,单边区间底,2,0); explainex(中枢数量=2, 单边区间高 : ,单边区间高,2,1);