缠论买卖点主图
本帖是根据几位前辈的指标合成而成,自用方便,在此对几位前辈深表感谢!
参数设定:0=关,1=关;
布林 0 1 1
均线 0 1 1
三k线 0 1 1
峰谷 0 1 1
趋势 0 1 1
支压 0 1 1
参数设定上可对(布林,均线,三k线,峰谷,趋势,支压)分别开关,方便视图.
图中加入(macd,kdj,rsi)顶底背离仅供参考
参数设定: 布林 0 1 1 均线 0 1 1 三k线 0 1 1 峰谷 0 1 1 趋势 0 1 1 支压 0 1 1 布林:=if(布林,1,drawnull); 布林中轨 :ma(close,20)*布林,dotline,colorwhite; 布林上轨:(布林中轨+2*std(close,20))*布林,dotline,coloryellow; 布林下轨:(布林中轨-2*std(close,20))*布林,dotline,colormagenta; drawband(布林中轨,rgb(99,00,50),布林上轨,rgb(99,00,50)); drawband(布林中轨,rgb(00,50,99),布林下轨,rgb(00,50,99)); drawband(布林中轨,rgb(99,00,50),布林上轨,rgb(99,00,50)); drawband(布林中轨,rgb(00,50,99),布林下轨,rgb(00,50,99)); 均线:=if(均线,1,drawnull); ma5:ma(c,5)*均线,colorwhite; ma10:ma(c,10)*均线,colorblue; 三k线:=if(三k线,1,drawnull); dg:=max(max(refx(l,1),refx(l,2)),refx(l,3)); gd:=min(min(refx(h,1),refx(h,2)),refx(h,3)); aa11:=(dg+gd)/2; a11:=aa11>refx(l,3) and refx(l,2)< aa11 and refx(l,1) <aa11 ; a21:=filter(a11,barslast(a11)+2); a41:=a11 and a21; a51:=if(ref(a41,1),h,0),nodraw; stickline(三k线=1 && ref(a41,2),ref(gd,2),ref(dg,2),13,-1),colorwhite; drawkline(h,o,l,c); {峰谷} 峰谷:=if(峰谷,1,drawnull); pa:=10; pb:=ref(high,pa)=hhv(high,2*pa+1); pc:=filter(pb,pa); pd:=backset(pc,pa+1); pe:=filter(pd,pa);{高点}} 峰线:(ref(high,barslast(pe)))*峰谷,colorred,pointdot,linethick4; aa21:=ref(low,pa)=llv(low,2*pa+1); bb21:=filter(aa21,pa); cc21:=backset(bb21,pa+1); dd21:=filter(cc21,pa);{低点} 谷线:(ref(low,barslast(dd21)))*峰谷,colorgreen,pointdot,linethick4; {趋势线} 趋势:=if(趋势,1,drawnull); r11:=backset(islastbar,barslast(pe)+1); s11:=r11>ref(r11,1); 压力轨:(drawline(pe,high,s11,high,1))*趋势,colorred; t11:=backset(islastbar,barslast(dd21)+1); u11:=t11>ref(t11,1); 支撑轨:(drawline(dd21,low,u11,low,1))*趋势,colorgreen; 中轨:((压力轨+支撑轨)/2)*趋势,colorwhite; {支压线} 支压:=if(支压,1,drawnull); p:=5;p1:=10;{p1、p2为短、长支撑压力取点参数} aa1:=ref(h,p)=hhv(h,2*p+1); bb1:=filter(aa1,p); cc1:=backset(bb1,p+1); dd1:=filter(cc1,p); ee1:=backset(islastbar,barslast(dd1)+1); ff1:=ee1>ref(ee1,1);{好公式网-最好的股票公式网站 www.goodgongshi.com} 短压:(drawline(dd1,h,ff1,h,1))*支压,colorlired; 短压线:(drawicon(ff1,h*1,2))*支压; aa2:=ref(l,p)=llv(l,2*p+1); bb2:=filter(aa2,p); cc2:=backset(bb2,p+1); dd2:=filter(cc2,p); ee2:=backset(islastbar,barslast(dd2)+1); ff2:=ee2>ref(ee2,1); 短支:(drawline(dd2,l,ff2,l,1))*支压,colorligreen; 短支线:(drawicon(ff2,l*1,1))*支压; {三角形中枢} 时间:=4; a:=h=hhv(h,时间*5) and hhv(h,时间*5)>ref(hhv(h,时间*5),1); b:=l=llv(l,时间*5) and llv(l,时间*5)<ref(llv(l,时间*5),1); cca:drawline(a,h,b,l,0),coloryellow,linethick2; ccb:drawline(b,l,a,h,0),colormagenta,linethick2; n:=(0,1,1); {缠论高低点} 局部低点预选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(l>ref(h,1),1,if(h<ref(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 l<ref(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 h>ref(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 l<ref(h,距前高天+1),-1,0); 距前高天a:=barslast(高保留=1); 距前低天a:=barslast(低保留=-1); 预判x:=if((距前低天a<4 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 h>ref(l,距前低天a+1),1,0); 预判xa:=if((距前高天a<4 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 l<ref(h,距前高天a+1),-1,0); 距前高天ya:=barslast(高保留x=1); 距前低天ya:=barslast(低保留x=-1); 预判yx:=if((距前低天ya<4 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 h>ref(l,距前低天ya+1),1,0); 预判yxa:=if((距前高天ya<4 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 l<ref(h,距前高天ya+1),-1,0); aaad:=if(高保留yx=1 and 低保留yx=-1 and h>ref(h,ref(距前高天ya,1)+2),1,if(高保留yx=1 and 低保留yx=-1 and l<ref(l,ref(距前低天ya,1)+2),-1,0)); 极点保留:=if(aaad=0,高保留yx+低保留yx,aaad); 局部极点:=if(极点保留=-1,l,if(极点保留=1,h,drawnull)),circledot,colorlimagenta; c1:drawline(极点保留=-1,局部极点,极点保留=1,局部极点,0),colormagenta,dotline; c2:drawline(极点保留=1,局部极点,极点保留=-1,局部极点,0),coloryellow,dotline; drawtext(极点保留=1,局部极点,'卖'),colorgreen; drawtext(极点保留=-1,局部极点,'买'),colorred; {顶底背离} lc:=ref(close,1); rsi:=((sma(max((close - lc),0),3,1) / sma(abs((close - lc)),3,1)) * 100); ff:=ema(close,3); ma15:=ema(close,21); drawtext(cross(ff,ma15),(low *0.999),'底背离'),colorred; {顶背离}{好公式网-最好的股票公式网站 www.goodgongshi.com} rsi1:=((sma(max((close - (ref(close,1))),0),3,1) / sma(abs((close - (ref(close,1)))),3,1))* 100); drawtext(cross(88,rsi1) and (ma(c,3))>(ema(c,3)) ,(high *1.001),'顶背离'),colorgreen; drawtext(ref(c,barslast(ref(cross("macd.dif","macd.dea"),1))+1)>c and ref("macd.dif",barslast(ref(cross("macd.dif","macd.dea"),1))+1) <"macd.dif" and cross("macd.dif","macd.dea") >0,l-0.002,'macd底背离'),colorred;{macd底背离} drawtext(ref(c,barslast(ref(cross("kdj.k","kdj.d"),1))+1)>c and ref("kdj.k",barslast(ref(cross("kdj.k","kdj.d"),1))+1)<"kdj.k" and cross("kdj.k","kdj.d"),l-0.003,'kdj底背离'),colorblue;{kdj底背离} drawtext(ref(c,barslast(ref(cross("rsi.rsi1","rsi.rsi2"),1))+1)>c and ref("rsi.rsi1",barslast(ref(cross("rsi.rsi1","rsi.rsi2"),1))+1) <"rsi.rsi1" and cross("rsi.rsi1","rsi.rsi2") >0,l-0.004,'rsi底背离');{rsi底背离}; drawtext(ref(c,barslast(ref(cross("macd.dea","macd.dif"),1))+1)<c and ref("macd.dif",barslast(ref(cross("macd.dea","macd.dif"),1))+1) >"macd.dif" and cross("macd.dea","macd.dif") >0,h+0.002,'macd顶背离'),colorgreen;{macd顶背离}; drawtext(ref(c,barslast(ref(cross("kdj.d","kdj.k"),1))+1)<c and ref("kdj.k",barslast(ref(cross("kdj.d","kdj.k"),1))+1) >"kdj.k" and cross("kdj.d","kdj.k")>0,h+0.003,'kdj顶背离');{kdj顶背离};
上一指标公式:好用的周KDJ-在日线下直接看周线KDJ指标下载 通达信源码
下一指标公式:XS2自制最好捉红(主图指标源码)下载 通达信源码
☉ 好公式网发布的指标公式主要用于软件技术面分析,仅供参考,勿用于实际操作,据此操作风险自负!
☉ 解压密码:www.goodgongshi.com 就是好公式网域名,希望大家看清楚,切勿输错。
☉ tnc和tni格式指标公式,仅可以用通达信软件引入使用,例如可以用通达信软件引入使用指标公式;
☉ tne格式指标公式,仅可以用通达信软件公式编辑器5.0版导入,高版本兼容低版本;
☉ fnc格式指标公式,可以用大智慧软件新一代高速行情分析系统股票软件使用,少部分可以用分析家软件引入使用;
☉ alg格式指标公式,仅仅可以用飞狐交易师软件引入使用;exp格式指标公式,仅可以用大智慧经典版软件引入使用;
☉ hxf格式指标公式,仅可以用同花顺软件引入使用。
☉ 如果您发现下载软件链接错误,请联系管理员报告错误。
☉ 好公式网欢迎各位网友帮忙宣传转发本站网址,有您的支持,我们会做得更好!
☉ 本文缠论买卖点主图(主图源码)下载 通达信源码仅供学习研究。