通达信高品质高量突破主图指标 源码分享 附图
{高量突破主图}
C1:=REF(C,1);
C2:=REF(C,2);
C3:=REF(C,3);
C4:=REF(C,4);
C5:=REF(C,5);
C6:=REF(C,6);
O1:=REF(O,1);
O2:=REF(O,2);
O3:=REF(O,3);
O4:=REF(O,4);
MA5:MA(C,5),COLORYELLOW,LINETHICK1;
MA20:MA(C,20),COLORLIMAGENTA ,LINETHICK1;
MA60:MA(C,60),COLORGREEN,LINETHICK1;
P1:=C2<=C3 AND C2<=C4 AND C2<=C5 AND C2<=C6;
P2:=C>MA(C,5) AND C>MA(C,10) AND C>MA(C,20);
P3:=C>O AND C1>C2;
P4:=C>C1;
CAP1:=CAPITAL>=8000 AND CAPITAL<=5000000;
S:=IF(NAMELIKE('S'),1,0)=0;
ST:=IF(NAMELIKE('ST'),1,0)=0;
SST:=IF(NAMELIKE('*S'),1,0)=0;
停牌:=IF((C=0 OR V=0),0,1);
PE:=C/FINANCE(33);
SYL:=PE>0;
JBM:=S AND ST AND SST AND 停牌 AND SYL;
P:=P1 AND P2 AND P3 AND P4 AND JBM AND C1/C2<=1.05;
STICKLINE(P,O,O+0.382*(C-O),3,0),COLORYELLOW;
STICKLINE(P,O+0.382*(C-O),C,3,0),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0,0,0,HYBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0,0.05,0,DYBLOCK);
LTSZ:=C*CAPITAL/1000000;
LTSZ1:=CON2STR(LTSZ,0);
DRAWTEXT_FIX(LTSZ>1,0,0.1,0,LTSZ1);
N:=6;
T1:=CONST(LLVBARS(LOW,N));
T1HIGH:=CONST(REF(HIGH,T1));
CC:=CONST(CURRBARSCOUNT);
T2:=CONST(BARSLAST((CURRBARSCOUNT >(CC+T1)) AND (HIGH>T1HIGH)));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST((CURRBARSCOUNT >(CC+T2)) AND (HIGH>T2HIGH)));
T3HIGH:=CONST(REF(HIGH,T3));
突破杀入线:DRAWLINE(CURRBARSCOUNT=T3+1, T3HIGH, ISLASTBAR, T3HIGH, 1),DOTLINE,COLOR1188FF;
DRAWTEXT(ISLASTBAR, T3HIGH, '突破加仓!'),LINETHICK1,COLOR1188FF;
STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;
NE:=IF(NAMELIKE('S') OR NAMELIKE('*S'),0.05,0.1);
跌停:=REF(C,1)/C-1>=NE-0.01/REF(C,1) AND L=C AND PERIOD=5;
STICKLINE(跌停,C,O,-1,0),COLOR00FF00;
STICKLINE(H-C>0 AND H=ZTPRICE(REF(C,1),0.1),O,C,3,0),COLORRED;
DIF:=EMA(DCLOSE,9)-EMA(DCLOSE,17);
DEA:=EMA(DIF,6);
AAA:=(DIF-DEA)*2*60;
起爆:=CROSS(AAA-REF(AAA,1),12);
DRAWTEXT(起爆,L*0.975,'★起爆'),COLORRED;
高:=REF(HHV(H,150),3);
近期顶:=REFDATE(高,DATE);
最顶:=REFDATE(近期顶,DATE),NODRAW;
出:=最顶=H AND ((C-L)< (O-C) OR (O-L)< (C-O)),NODRAW;
STICKLINE(出,O,(C+O)/2,3,0),COLORBLUE;
STICKLINE(出,H,L,0.2,0),COLORBLUE;
DRAWTEXT(出,H*0.998,'↙蓝顶'),COLORGREEN;
B1:=HHV(REF(V,1),125);
B2:=V=CONST(B1);
B3:=BARSLAST(B2);
高量125:IF(B3<=125,REF(H,B3),DRAWNULL),COLOR00FF00,DOTLINE;
总涨幅周期:=350;
高点位:=REFDATE(HHV(H,总涨幅周期),DATE);
低点位:=REFDATE(LLV(L,总涨幅周期),DATE);
低位价:=REF(L,BARSLAST(低点位=L)),COLORGREEN;
高位价:=REF(H,BARSLAST(高点位=H)),COLORRED,NODRAW;
曾最大涨幅:=(高位价-低位价)/低位价*100;
当前涨幅:=(C-低位价)/低位价*100;
ZFA:=CON2STR(CONST(曾最大涨幅),2);
ZFB:=CON2STR(CONST(当前涨幅),2);
ZFC:=STRCAT('【曾最大涨幅】:',ZFA);
ZFD:=STRCAT(ZFC,'%');
ZFE:=STRCAT(ZFD,'【当前总涨幅】:');
ZFF:=STRCAT(ZFE,ZFB);
ZFG:=STRCAT(ZFF,'%');
DRAWTEXT_FIX(ISLASTBAR,0,1,0,'▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇'),COLOR666666;
DRAWTEXT_FIX(ISLASTBAR,0,1,0,ZFG),COLORYELLOW;
Z1:=STRCAT(DYBLOCK,' ');
Z2:=STRCAT(Z1,HYBLOCK);
Z3:=STRCAT(Z2,' ');
Z4:=STRCAT(Z3,GNBLOCK);
Z5:=STRCAT(Z4,' ');
Z6:=STRCAT(Z5,FGBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.01,0.012,0,STRCAT(Z6,ZHBLOCK)),COLORCYAN;
DRAWTEXT_FIX(1,0,0.075,0,STRCAT('【自定板块】:',ZDBLOCK)),COLORYELLOW;
月DIF:="MACD.DIF#MONTH";
月DEA:="MACD.DEA#MONTH",;
周DIF:="MACD.DIF#WEEK";
周DEA:="MACD.DEA#WEEK",;
日DIF:="MACD.DIF";
日DEA:="MACD.DEA";
日金叉:=CROSS(日DIF,日DEA);
周金叉:=CROSS(周DIF,周DEA);
月金叉:=CROSS(月DIF,月DEA);
金叉共振:=IF(CROSS(周DIF,周DEA),MACD+0.1,0),COLORWHITE,LINETHICK2;
共振:=IF((日DIF>日DEA AND 周DIF>周DEA AND 月金叉) OR ( 周DIF>周DEA AND 月DIF>月DEA AND 日金叉) AND C/REF(C,1)>1.08 OR (月DIF>月DEA AND 日DIF>日DEA AND 周金叉) OR (日金叉 AND 周金叉 AND 月金叉),MACD+0.2,0),COLORF00FF0,LINETHICK3;
STICKLINE(金叉共振 AND C/REF(C,1)>1.05,O,REF(C,1)*1.05,3.2,0),COLOR0077FF;
STICKLINE(金叉共振 AND C/REF(C,1)>1.05,O,REF(C,1)*1.05,2.5,0),COLOR0099FF;
STICKLINE(金叉共振 AND C/REF(C,1)>1.05,O,REF(C,1)*1.05,1.9,0),COLOR00BBFF;
STICKLINE(金叉共振 AND C/REF(C,1)>1.05,O,REF(C,1)*1.05,1.2,0),COLOR00DDFF;
STICKLINE(金叉共振 AND C/REF(C,1)>1.05,O,REF(C,1)*1.05,0.3,0),COLOR00FFFF;
STICKLINE(共振 AND C/REF(C,1)>1.08,C,REF(C,1)*1.05,3,0),COLOR000099;
STICKLINE(共振 AND C/REF(C,1)>1.08,C,REF(C,1)*1.05,2.2,0),COLOR0000CC;
STICKLINE(共振 AND C/REF(C,1)>1.08,C,REF(C,1)*1.05,1.5,0),COLOR0000FF;
STICKLINE(共振 AND C/REF(C,1)>1.08,C,REF(C,1)*1.05,0.5,0),COLORCC66FF;
STICKLINE(共振 AND C/REF(C,1)>1.08,REF(C,1)*1.05,C,0.5,0),COLORYELLOW;
DRAWTEXT(共振 AND C/REF(C,1)>1.08,REF(C,1)*1.058,'↖起爆捉妖'),COLORYELLOW;
DRAWTEXT(金叉共振 AND C/REF(C,1)>1.05,REF(C,1)*1.028,'↖妖股初现'),COLORRED;
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
A1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
A2:=BARSLAST(REF(CROSS(DIFF,DEA),1));
ZD:REF(L,A1),COLORRED,LINETHICK3;
DRAWTEXT(A1+1,L*0.99,'前底'),COLORFFFF00;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:FINANCE
该公式包含未来函数:#MONTH
该公式包含未来函数:#WEEK
该公式包含未来函数:DCLOSE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{高量突破主图}C1赋值:1日前的C
C2赋值:2日前的C
C3赋值:3日前的C
C4赋值:4日前的C
C5赋值:5日前的C
C6赋值:6日前的C
O1赋值:1日前的O
O2赋值:2日前的O
O3赋值:3日前的O
O4赋值:4日前的O
输出MA5:C的5日简单移动平均,画黄色,LINETHICK1
输出MA20:C的20日简单移动平均,COLORLIMAGENTA ,LINETHICK1
输出MA60:C的60日简单移动平均,COLORGREEN,LINETHICK1
P1赋值:C2<=C3 AND C2<=C4 AND C2<=C5 AND C2<=C6
P2赋值:C>C的5日简单移动平均 AND C>C的10日简单移动平均 AND C>C的20日简单移动平均
P3赋值:C>O AND C1>C2
P4赋值:C>C1
CAP1赋值:CAPITAL>=8000 AND CAPITAL<=5000000
S赋值:IF(NAMELIKE('S'),1,0)=0
ST:=IF(NAMELIKE('ST'),1,0)=0
SST:=IF(NAMELIKE('*S'),1,0)=0
停牌赋值:IF((C=0 OR V=0),0,1)
PE赋值:C/FINANCE(33)
SYL:=PE>0
JBM赋值:S AND ST AND SST AND 停牌 AND SYL
P赋值:P1 AND P2 AND P3 AND P4 AND JBM AND C1/C2<=1.05
STICKLINE(P,O,O+0.382*(C-O),3,0),画黄色
STICKLINE(P,O+0.382*(C-O),C,3,0),画红色
当满足条件ISLASTBAR时,在横轴0纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0纵轴0.05位置书写文字
LTSZ:=C*CAPITAL/1000000
LTSZ1赋值:CON2STR(LTSZ,0)
当满足条件LTSZ>1时,在横轴0纵轴0.1位置书写文字
N赋值:6
T1赋值:CONST(LLVBARS(最低价,N))
T1最高价:=CONST(T1日前的最高价)
CC赋值:CONST(CURRBARSCOUNT)
T2赋值:CONST(上次(CURRBARSCOUNT >(CC+T1距今天数) AND (最高价>T1最高价)))
T2最高价:=CONST(T2日前的最高价)
T3赋值:CONST(上次(CURRBARSCOUNT >(CC+T2距今天数) AND (最高价>T2最高价)))
T3最高价:=CONST(T3日前的最高价)
输出突破杀入线:DRAWLINE(CURRBARSCOUNT=T3+1, T3最高价, ISLASTBAR, T3最高价, 1),DOTLINE,COLOR1188FF
当满足条件ISLASTBAR时,在 T3最高价和 '突破加仓!'位置书写文字
STICKLINE(C/1日前的C>1.095,C,O,2,0),画黄色
NE:=IF(NAMELIKE('S') OR NAMELIKE('*S'),0.05,0.1)
跌停赋值:1日前的C/C-1>=NE-0.01/1日前的C AND L=C AND PERIOD=5
当满足条件跌停时,在C和O之间画柱状线
STICKLINE(H-C>0 AND H=ZTPRICE(1日前的C,0.1),O,C,3,0),画红色
DIF赋值:DCLOSE的9日指数移动平均-DCLOSE的17日指数移动平均
DEA赋值:DIF的6日指数移动平均
AAA赋值:(DIF-DEA)*2*60
起爆赋值:CROSS(AAA-1日前的AAA,12)
当满足条件起爆时,在L*0.975和'★起爆'位置书写文字
高赋值:REF(150日内H最高值,3)
近期顶赋值:REFDATE(高,DATE)
最顶赋值:REFDATE(近期顶,DATE),NODRAW
出赋值:最顶=H AND ((C-L)< (O-C) OR (O-L)< (C-O)),NODRAW
STICKLINE(出,O,(C+O)/2,3,0), 画蓝色
当满足条件出时,在H和L之间画柱状线
当满足条件出时,在H*0.998和'↙蓝顶'位置书写文字
B1赋值:125日内1日前的V最高值
B2赋值:V=CONST(B1)
B3赋值:上次B2距今天数
高量125:IF(B3<=125,B3日前的H,DRAWNULL),COLOR00FF00,DOTLINE
总涨幅周期赋值:350
高点位:=REFDATE(总涨幅周期日内H最高值,DATE)
低点位赋值:REFDATE(总涨幅周期日内L最低值,DATE)
低位价赋值:REF(L,上次低点位=L距今天数),COLORGREEN
高位价:=REF(H,上次高点位=H距今天数),画红色,NODRAW
曾最大涨幅赋值:(高位价-低位价)/低位价*100
当前涨幅赋值:(C-低位价)/低位价*100
ZFA赋值:CON2STR(CONST(曾最大涨幅),2)
ZFB赋值:CON2STR(CONST(当前涨幅),2)
ZFC赋值:STRCAT('【曾最大涨幅】:',ZFA)
ZFD赋值:STRCAT(ZFC,'%')
ZFE赋值:STRCAT(ZFD,'【当前总涨幅】:')
ZFF赋值:STRCAT(ZFE,ZFB)
ZFG赋值:STRCAT(ZFF,'%')
当满足条件ISLASTBAR时,在横轴0纵轴1位置书写文字
当满足条件ISLASTBAR时,在横轴0纵轴1位置书写文字
Z1赋值:STRCAT(DYBLOCK,' ')
Z2赋值:STRCAT(Z1,HYBLOCK)
Z3赋值:STRCAT(Z2,' ')
Z4赋值:STRCAT(Z3,GNBLOCK)
Z5赋值:STRCAT(Z4,' ')
Z6赋值:STRCAT(Z5,FGBLOCK)
DRAWTEXT_FIX(ISLASTBAR,0.01,0.012,0,STRCAT(Z6,ZHBLOCK)),COLORCYAN
DRAWTEXT_FIX(1,0,0.075,0,STRCAT('【自定板块】:',ZDBLOCK)),画黄色
月DIF赋值:"MACD.DIF#MONTH"
月DEA赋值:"MACD.DEA#MONTH",
周DIF赋值:"MACD.DIF#WEEK"
周DEA赋值:"MACD.DEA#WEEK",
日DIF赋值:"MACD.DIF"
日DEA赋值:"MACD.DEA"
日金叉赋值:日DIF上穿日DEA
周金叉赋值:周DIF上穿周DEA
月金叉赋值:月DIF上穿月DEA
金叉共振赋值:IF(周DIF上穿周DEA,MACD+0.1,0),画白色,LINETHICK2
共振赋值:IF((日DIF>日DEA AND 周DIF>周DEA AND 月金叉) OR ( 周DIF>周DEA AND 月DIF>月DEA AND 日金叉) AND C/1日前的C>1.08 OR (月DIF>月DEA AND 日DIF>日DEA AND 周金叉) OR (日金叉 AND 周金叉 AND 月金叉),MACD+0.2,0),COLORF00FF0,LINETHICK3
STICKLINE(金叉共振 AND C/1日前的C>1.05,O,1日前的C*1.05,3.2,0),COLOR0077FF
STICKLINE(金叉共振 AND C/1日前的C>1.05,O,1日前的C*1.05,2.5,0),COLOR0099FF
STICKLINE(金叉共振 AND C/1日前的C>1.05,O,1日前的C*1.05,1.9,0),COLOR00BBFF
STICKLINE(金叉共振 AND C/1日前的C>1.05,O,1日前的C*1.05,1.2,0),COLOR00DDFF
STICKLINE(金叉共振 AND C/1日前的C>1.05,O,1日前的C*1.05,0.3,0),COLOR00FFFF
STICKLINE(共振 AND C/1日前的C>1.08,C,1日前的C*1.05,3,0),COLOR000099
STICKLINE(共振 AND C/1日前的C>1.08,C,1日前的C*1.05,2.2,0),COLOR0000CC
STICKLINE(共振 AND C/1日前的C>1.08,C,1日前的C*1.05,1.5,0),COLOR0000FF
STICKLINE(共振 AND C/1日前的C>1.08,C,1日前的C*1.05,0.5,0),COLORCC66FF
STICKLINE(共振 AND C/1日前的C>1.08,1日前的C*1.05,C,0.5,0),画黄色
DRAWTEXT(共振 AND C/1日前的C>1.08,1日前的C*1.058,'↖起爆捉妖'),画黄色
DRAWTEXT(金叉共振 AND C/1日前的C>1.05,1日前的C*1.028,'↖妖股初现'),画红色
DIFF:=CLOSE的12日指数移动平均-CLOSE的26日指数移动平均
A1赋值:上次1日前的DEA上穿DIFF距今天数
A2赋值:上次1日前的DIFF上穿DEA距今天数
输出ZD:A1日前的L,画红色,LINETHICK3
当满足条件A1+1时,在L*0.99和'前底'位置书写文字