通达信精进叁号主图指标源码
A0:=(L+H+C*2)/4;
A1:EMA(A0,14)COLORBLUE,LINETHICK2;
A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2;
A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;
A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW;
出击:IF(A1X>=0 AND BARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRAWNULL),COLORMAGENTA,LINETHICK2;
逃遁:IF(A1X<0 AND BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL),COLORGREEN,LINETHICK2;
铁:IF(A1X>=0,A1,DRAWNULL)COLORRED,LINETHICK2;
律:IF(A1X<0 AND A2X<0,A1,DRAWNULL)COLORGREEN,LINETHICK2;
STICKLINE(CROSS(A1X,0),H,L,0,0 ),COLOR9933FF;
STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;
STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;
STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;
STICKLINE(CROSS(0,A1X),C,O,3,0),COLOR00CC00;
STICKLINE(CROSS(0,A1X),C,O,1,0),COLOR66FF00;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORRED;
DEA:=EMA(DIFF,9),COLORYELLOW;
MACD:=2*(DIFF-DEA),COLORSTICK;
周DIF:="MACD.DIF#WEEK"(12,26,9);
周DEA:="MACD.DEA#WEEK"(12,26,9);
周MACD:="MACD.MACD#WEEK"(12,26,9);
DRAWTEXT(CROSS(DIFF,DEA)AND CROSS(周DIF,周DEA),L*0.91,'MM-G');
A3:=BARSLAST(REF(CROSS(DIFF,DEA),1)); {股票指标网}
B1:=REF(C,A3+1)>C AND REF(DIFF,A3+1)<DIFF AND CROSS(DIFF,DEA);
A4:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A4+1)>C AND REF("KDJ.K"(9,3,3),A4+1)<"KDJ.K"(9,3,3) AND CROSS ("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A5:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A5+1)>C AND REF("RSI.RSI1"(6,12,24),A5+1)<"RSI.RSI1"(6,12,24) AND CROSS ("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
B4:=CROSS(DIFF,DEA) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(B1,L*0.99,'M'),COLORWHITE;
DRAWTEXT(B2,L*0.97,'K'),COLORFF00FF;
DRAWTEXT(B3,L*0.95,'R'),COLORYELLOW;
DRAWTEXT(B4,L*0.93,'MK-G'),COLOR0099FF;
未来函数检测结果如下:
该公式包含未来函数:#WEEK
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
A0赋值:(L+H+C*2)/4
输出
A1:A0的14日指数移动平均 画蓝色, 线宽为2
A2赋值:A0的25日指数移动平均COLORLIBLUE, 线宽为2
A1X:=(A1-1日前的A1)/1日前的A1*100,NODRAW
A2X:=(A2-1日前的A2)/1日前的A2*100,NODRAW
输出
出击:IF(A1X>=0 AND 上次A1X上穿0距今天数>0,REF((C+O)/2,上次A1X上穿0距今天数),DRAWNULL),画洋红色, 线宽为2
输出
逃遁:IF(A1X<0 AND 上次0上穿A1X距今天数>0,REF((C+O)/2,上次0上穿A1X距今天数),DRAWNULL),画绿色, 线宽为2
如果A1X>=0返回A1否则返回DRAWNULL
如果A1X<0 AND A2X<0返回A1否则返回DRAWNULL
STICKLINE(A1X上穿0,H,L,0,0 ),COLOR9933FF
STICKLINE(A1X上穿0,C,O,3,0 ),COLOR0000CC
STICKLINE(A1X上穿0,C,O,1,0 ),COLOR0033FF
STICKLINE(0上穿A1X,L,H,0,0 ),COLOR66CC33
STICKLINE(0上穿A1X,C,O,3,0),COLOR00CC00
STICKLINE(0上穿A1X,C,O,1,0),COLOR66FF00
DIFF赋值:收盘价的12日指数移动平均 - 收盘价的26日指数移动平均,画红色
DEA赋值:DIFF的9日指数移动平均,画黄色
MACD赋值:2*(DIFF-DEA),COLORSTICK
周DIF赋值:"MACD.DIF#WEEK"(12,26,9)
周DEA赋值:"MACD.DEA#WEEK"(12,26,9)
周MACD赋值:"MACD.MACD#WEEK"(12,26,9)
DRAWTEXT(DIFF上穿DEAAND 周DIF上穿周DEA,L*0.91,'MM-G')
A3赋值:上次1日前的DIFF上穿DEA距今天数
{股票指标网}
B1赋值:A3+1日前的C>C AND A3+1日前的DIFF
A4赋值:上次REF(CROSS("KDJ.K"(9,3,3距今天数,"KDJ.D"(9,3,3)),1))
B2赋值:A4+1日前的C>C AND REF("KDJ.K"(9,3,3),A4+1)<"KDJ.K"(9,3,3) AND CROSS ("KDJ.K"(9,3,3),"KDJ.D"(9,3,3))
A5赋值:上次REF(CROSS("RSI.RSI1"(6,12,24距今天数,"RSI.RSI2"(6,12,24)),1))
B3赋值:A5+1日前的C>C AND REF("RSI.RSI1"(6,12,24),A5+1)<"RSI.RSI1"(6,12,24) AND CROSS ("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24))
B4赋值:DIFF上穿DEA AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3))
当满足条件B1时,在L*0.99和'M'位置书写文字
当满足条件B2时,在L*0.97和'K'位置书写文字
当满足条件B3时,在L*0.95和'R'位置书写文字
当满足条件B4时,在L*0.93和'MK-G'位置书写文字