通达信乖金买卖副图指标 深化乖离指标 乖金+黄柱 源码附图
DRAWGBK(C>O,RGB(50,10,0),RGB(0,0,30),0,0,0);
RS1:=SMA(MAX(C-REF(C,1),0),7,1)/SMA(ABS(C-REF(C,1)),7,1)*100;
强弱买:FILTER(REF(RS1,1)< 20 AND RS1>REF(RS1,1),5)*2,COLORLIRED;
BIAS1:=(C-MA(C,6))/MA(C,6)*100;
BIAS2:=(C-MA(C,12))/MA(C,12)*100;
BIAS3:=(C-MA(C,24))/MA(C,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,3);
乖深低:IF(乖离<=-8,-0.35,0),LINETHICK1,COLORGREEN;
乖浅低:IF(BETWEEN(BIAS,-2,-8),-0.2,0),LINETHICK1,COLORLIGRAY;
乖买:REF(乖浅低=-0.2,1)AND BIAS>REF(BIAS,1),COLORLIMAGENTA,NODRAW;
乖低金:CROSS(BIAS,乖离) AND REF(乖离< -4.5,1),COLORRED,NODRAW;
DRAWBAND(0,RGB(0,100,0),乖深低,0);
DRAWBAND(0,RGB(180,180,180),乖浅低,0);
STICKLINE(乖离<=-8,-0.2,0,1,0),COLORLIGREEN;
STICKLINE(乖浅低=-0.2,-0.1,0,1,0),COLORLIBLUE;
STICKLINE(乖买=1,-0.1,0,1,0),COLORLIMAGENTA;
STICKLINE(乖低金=1,-0.5,0,0,0),COLORRED;
更:(C-LLV(L,10))/(HHV(H,25)-LLV(L,10))*4,COLORMAGENTA;
好:EMA(更,3),COLORGREEN,DOTLINE;
A低:=更<=LLV(更,10),COLORWHITE,NODRAW;
买:REF(A低=1,1)AND 更>REF(更,1),COLORRED,NODRAW;
卖:IF(REF(更>=HHV(更,10),1)AND 更< REF(更,1),3.5,4),COLORLICYAN;
高:"DMI.PDI"(14,6)>33 AND "DMI.MDI"(14,6)< 10 AND "DMI.ADX"(14,6)>40 AND "DMI.ADXR"(14,6)>45,STICK,COLORBROWN,LINETHICK2;
险:((HHV(好,4)>3.6 OR 更>=3.8)AND 高=1)*0.5,STICK,COLORLICYAN,LINETHICK3;
调:IF(高=0 AND HHV(高,5)>0,-0.5,0),STICK,COLORGREEN,LINETHICK2;
可卖:=IF(险=1 AND H-C>C-L AND V>HHV(V,20)/2 AND C< O*1.01,-0.75,0),STICK,COLORCYAN,LINETHICK2;
出:IF(险=0 AND HHV(险,3)>0,-1,0),STICK,COLORCYAN,LINETHICK2;
遇警:=IF(可卖=-0.75,-0.75,IF(出< 0,-1,IF(险>0,1,IF(调< 0,-0.5,高)))),COLORSTICK;
KM:=REF(更<=LLV(更,10),1)AND 更>REF(更,1);
可买:IF(FILTER((C-L>H-C AND V>HHV(V,13)*0.4 OR KM=1)AND(乖深低=-0.35 OR 乖浅低=-0.2 OR 调=-0.5),1),0.3,0),STICK,COLORYELLOW,LINETHICK2;
关联:IF(可卖=-0.75,-0.75,IF(出< 0,-1,IF(险>0,1,IF(调< 0,-0.5,高)))),COLORRED,LINETHICK1;
STICKLINE(A低=1,1,1.1,1,0),COLORWHITE;
STICKLINE(买=1,1,1.1,1,0),COLORRED;
DRAWTEXT(乖低金=1,-0.5,' 乖金'),COLORRED;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
填充背景(C>O,RGB(50,10,0),RGB(0,0,30),0,0,0)
RS1赋值:SMA(C-1日前的C和0较大值,7,1)/SMA(C-1日前的C的绝对值,7,1)*100
输出强弱买:FILTER(1日前的RS1< 20 AND RS1>1日前的RS1,5)*2,COLORLIRED
BIAS1赋值:(C-C的6日简单移动平均)/C的6日简单移动平均*100
BIAS2赋值:(C-C的12日简单移动平均)/C的12日简单移动平均*100
BIAS3赋值:(C-C的24日简单移动平均)/C的24日简单移动平均*100
BIAS赋值:(BIAS1+2*BIAS2+3*BIAS3)/6
乖离赋值:BIAS的3日简单移动平均
如果乖离<=-8返回-0.35否则返回0
输出乖浅低:IF(BETWEEN(BIAS,-2,-8),-0.2,0),LINETHICK1,COLORLIGRAY
输出乖买:1日前的乖浅低=-0.2AND BIAS>1日前的BIAS,COLORLIMAGENTA,NODRAW
输出乖低金:BIAS上穿乖离 AND 1日前的乖离< -4.5,画红色,NODRAW
DRAWBAND(0,RGB(0,100,0),乖深低,0)
DRAWBAND(0,RGB(180,180,180),乖浅低,0)
当满足条件乖离<=-8时,在-0.2和0之间画柱状线
当满足条件乖浅低=-0.2时,在-0.1和0之间画柱状线
当满足条件乖买=1时,在-0.1和0之间画柱状线
当满足条件乖低金=1时,在-0.5和0之间画柱状线
输出更:(C-10日内L最低值)/(25日内H最高值-10日内L最低值)*4,画洋红色
输出好:更的3日指数移动平均,画绿色,DOTLINE
A低赋值:更<=10日内更最低值,画白色,NODRAW
输出买:1日前的A低=1AND 更>1日前的更,画红色,NODRAW
输出卖:IF(REF(更>=10日内更最高值,1)AND 更< REF(更,1),3.5,4),COLORLICYAN
输出高:"DMI.PDI"(14,6)>33 AND "DMI.MDI"(14,6)< 10 AND "DMI.ADX"(14,6)>40 AND "DMI.ADXR"(14,6)>45,STICK,COLORBROWN, 线宽为2
输出险:((4日内好最高值>3.6 OR 更>=3.8)AND 高=1)*0.5,STICK,COLORLICYAN, 线宽为3
输出调:IF(高=0 AND 5日内高最高值>0,-0.5,0),STICK,画绿色, 线宽为2
可卖赋值:IF(险=1 AND H-C>C-L AND V>20日内V最高值/2 AND C< O*1.01,-0.75,0),STICK,画青色, 线宽为2
输出出:IF(险=0 AND 3日内险最高值>0,-1,0),STICK,画青色, 线宽为2
遇警赋值:IF(可卖=-0.75,-0.75,IF(出< 0,-1,IF(险>0,1,IF(调< 0,-0.5,高)))),COLORSTICK
KM赋值:REF(更<=10日内更最低值,1)AND 更>REF(更,1)
可输出买:IF(FILTER((C-L>H-C AND V>13日内V最高值*0.4 OR KM=1)AND(乖深低=-0.35 OR 乖浅低=-0.2 OR 调=-0.5),1),0.3,0),STICK,画黄色, 线宽为2
输出关联:IF(可卖=-0.75,-0.75,IF(出< 0,-1,IF(险>0,1,IF(调< 0,-0.5,高)))),画红色,LINETHICK1
当满足条件A低=1时,在1和1.1之间画柱状线
当满足条件买=1时,在1和1.1之间画柱状线
当满足条件乖低金=1时,在-0.5和' 乖金'位置书写文字