通达信指标公式源码概况:
指标类别: 通达信指标公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
公式解读:
二、通达信波段为王主图指标公式
AAA:=(MA(CLOSE,13)+MA(CLOSE,17))/2;
CCC:=(STD(CLOSE,13)+STD(CLOSE,17))/2;
BBB:=AAA+2.1*CCC;
DDD:=AAA+0.72*CCC;
ZZZ:=IF(CCC 1.88,MA(DDD,3),DDD);
平衡:ZZZ;
止赢:ZZZ*1.1;
了结:ZZZ*1.05;
回档:ZZZ*0.95;
反弹:ZZZ*0.9;
DRAWTEXT(L =反弹ANDC OANDC 反弹,L*0.98, 买 ),COLORYELLOW;
DRAWTEXT(L =止赢ANDH =止赢ANDC OAND(REF(C,1)-C)/C 0.02,H*1.02, 卖
),COLORGREEN;
STICKLINE(L =反弹ANDC OANDC 反弹,O,C,2,0),COLORYELLOW;
STICKLINE(L =止赢ANDH =止赢AND
(REF(C,1)-C)/C 0.02,O,C,2,0),COLORGREEN;
AB:=EMA(((2*C+H+L)/4-LLV(LOW,30))/
(HHV(HIGH,30)-LLV(LOW,30))*100,8);
BA:=EMA(AB,5);
A1{高}:=REFDATE(REF(HHV(H,96),5),DATE);
B1{低}:=REFDATE(REF(LLV(L,96),5),DATE);
D{中}:=((A1)+(B1))/2;
五:MA(C,5)LINETHICK2,COLOR00FFFF;
二O:EMA(C,20),COLORMAGENTA;
空仓:IF(AB-BA 0,五,DRAWNULL),LINETHICK2,COLOR00FFFF;
持仓:IF(AB-BA 0,五,DRAWNULL),,LINETHICK2,COLORRED;
箱顶:IF(AB 0ANDAB-BA =0,A1,A1),LINETHICK3,COLOR00FF00;
箱腰:IF(AB 0ANDAB-BA =0,D,D),LINETHICK3,COLOR00FF00;
箱低:IF(AB 0ANDAB-BA =0,B1,B1),LINETHICK3,COLOR00FF00;
五:IF(CURRBARSCOUNT=6,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORWHITE,LINETHICK3;{五日转点}十:IF(CURRBARSCOUNT=11,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORYELLOW,LINETHICK3;{十日转点}
二十:IF(CURRBARSCOUNT=21,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORRED,LINETHICK3;{二十日转点};
三十:IF(CURRBARSCOUNT=31,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORCYAN,LINETHICK3;{三十日转点};
六十:IF(CURRBARSCOUNT=61,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORYELLOW,LINETHICK3;{六十日转点};
九十:IF(CURRBARSCOUNT=91,L*0.992-0.02,DRAWNULL),
CROSSDOT,COLORYELLOW,LINETHICK3;{九十日转点};
高1:IF(AB 0ANDABBA 0,A1,DRAWNULL),LINETHICK3,COLORRED;
中1:IF(AB 0ANDAB-BA 0,D,DRAWNULL),LINETHICK3,COLORRED;
低1:IF(AB 0
AB-BA 0,B1,DRAWNULL),LINETHICK3,COLORRED;
VAR4赋值:收盘价的5日简单移动平均
VAR5赋值:收盘价的10日简单移动平均
VAR6赋值:收盘价的30日简单移动平均
VARA赋值:(((收盘价*(手))*100)的4日累和 / (成交量(手)*100)的4日累和)
VARB赋值:((VARA*100)的整数部分 / 100)
VARC赋值:(((收盘价*成交量(手))*100)的7日累和 / (成交量(手)*100)的7日累和)
VARD赋值:((VARC*100)的整数部分 / 100)
VARE赋值:(((收盘价*成交量(手))*100)的28日累和 / (成交量(手)*100)的28日累和)
VARF赋值:((VARE*100)的整数部分 / 100)
趋势赋值:(收盘价的5日指数移动平均 - 收盘价的10日指数移动平均)
趋势赋值:短线趋势的9日指数移动平均
VAR14赋值:1日前的中线趋势
VAR15赋值:中线趋势
VAR16赋值:(VAR15 - VAR14)
VAR17赋值:1日前的短线趋势
VAR18赋值:短线趋势
VAR19赋值:(VAR18 - VAR17)
VAR1A赋值:开盘价
VAR1B赋值:收盘价
游资入柱赋值:VAR1A VAR4 AND VAR1A VAR5 AND VAR1A VAR6 AND VAR1B VAR4 AND VAR1B VARF AND VAR16 0 AND VAR19 0,NODRAW,画洋红色
WY1001赋值:(2*收盘价+最高价+最低价)/3
WY1002赋值:WY1001的3日指数移动平均
WY1003赋值:WY1002的3日指数移动平均
WY1004赋值:WY1003的3日指数移动平均
XYS0赋值:(WY1004-1日前的WY1004)/1日前的WY1004*100
XYS1赋值:XYS0的1日简单移动平均
XYS2赋值:XYS0的2日简单移动平均,画黄色
当满足条件游资入柱 0ANDCROSS(XYS1,XYS2)时,在0和5位置之间画柱状线,宽度为3,0不为0则画空心柱.,画洋红色
趋势:SMA(((CLOSE-LLV(LOW,28))/(HHV(HIGH,28)-LLV(LOW,28))*100),3,1),COL
ORYELLOW;
DRAWBAND(趋势,RGB(155,50,50),50,RGB(0,100,50));
{STICKLINE(趋势 50,趋势,50,6,0),COLORFF00FF;
STICKLINE(趋势 50,趋势,50,6,0),COLORGREEN;}
转强:IF(趋势 50,趋势,DRAWNULL),COLOR0000FF;
转弱:IF(趋势 50,趋势,DRAWNULL),COLORGREEN;
RSV:=(CLOSE-LLV(CLOSE,9))/(HHV(CLOSE,9)-LLV(CLOSE,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
DIFF:=EMA(CLOSE,2)-EMA(CLOSE,55);
DEA:=EMA(DIFF,6);
MACD:=2*(DIFF-DEA);
转点:=IF(K DANDCCI 0ANDDIFF DEAANDMACD 0,1,0);
STICKLINE(转点=1,50,50,2,0),COLORYELLOW;
STICKLINE(转点=0,50,50,2,0),COLORCYAN;
STICKLINE(C,90,90,1,0),COLORYELLOW;
STICKLINE(C,10,10,1,0),COLORCYAN;
判断:SMA(趋势,3,1),COLORYELLOW;
IF(判断 50AND趋势 判断,判断,DRAWNULL),COLORYELLOW,LINETHICK2;
IF(判断 50AND趋势 判断,判断,DRAWNULL),COLORFF00FF;
IF(判断 50AND趋势 判断,判断,DRAWNULL),COLORGREEN,LINETHICK2;
风险区:80,COLORFF85FF,POINTDOT;
安全区:20,COLORYELLOW,POINTDOT;
顶部:90,COLORFFFF00;
强弱线:50,COLORGREEN,POINTDOT;
DRAWICON(CROSS(趋势,判断)AND趋势 80,判断,1);
DRAWICON(CROSS(趋势,顶部),顶部,2);
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
VAR1:=(HHV(HIGH,9)-CLOSE)/(HHV(HIGH,9)-LLV(LOW,9))*100-70;
VAR2:=SMA(VAR1,9,1)+100;
VAR3:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
VAR4:=SMA(VAR3,3,1);
VAR5:=SMA(VAR4,3,1)+100;
VAR6:=VAR5-VAR2;
趋势1:IF(VAR6 45,VAR6-45,0),COLOR00FFFF;
VAR2Q:=REF(LOW,1);
VAR3Q:=SMA(ABS(LOW-VAR2Q),3,1)/SMA(MAX(LOW-VAR2Q,0),3,1)*100;
VAR4Q:=EMA(IF(CLOSE*1.3,VAR3Q*10,VAR3Q/10),3);
VAR5Q:=LLV(LOW,30);
VAR6Q:=HHV(VAR4Q,30);
VAR7Q:=IF(MA(CLOSE,58),1,0);
VAR8Q:=EMA(IF(LOW =VAR5Q,(VAR4Q+VAR6Q*2)/2,0),3)/999*VAR7Q;
火焰山:=IF(VAR8Q 100,100,VAR8Q);
STICKLINE(火焰山 0,0,火焰山*1.2,3,0),COLOR4444FF;
STICKLINE(火焰山 0,0,火焰山*1.2,2,0),COLOR7777FF;
STICKLINE(火焰山 0,0,火焰山*1.2,1,0),COLOR9999FF;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),3,0),COLOR000033;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),2,0),COLOR000077;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),1.5,0),COLOR0000BB;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),1,0),COLOR0000DD;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),3,0),COLOR003300;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),2,0),COLOR007700;
STICKLINE(REF(趋势1,1) 趋势1,趋势1,REF(趋势1,1),1,0),COLOR00DD00;
逃顶:=CROSS(82,RSI);
STICKLINE(逃顶,逃顶,20,3,0),COLORFF5500;
STICKLINE(逃顶,逃顶,30,2,0),COLORFF8800;
STICKLINE(逃顶,逃顶,30,1,0),COLORFFAA00;
STICKLINE(逃顶,逃顶,30,0.5,0),COLORFFCC00;
D1:=(C+L+H)/3;
D2:=EMA(D1,6);
D3:=EMA(D2,5);
BBUY:=CROSS(D2,D3);
DRAWICON(BBUY,10,1);
VARR1:=SMA(MAX(CLOSE-REF(C,1),0),6,1)/SMA(ABS(CLOSE-REF(C,1)),6,1)*
100;
DRAWICON(CROSS(82,VARR1),10,2);
神奇线:(CROSS(趋势,判断)AND趋势 80),LINETHICK0;
波段选股:(BBUY),LINETHICK0;
STICKLINE(神奇线选股AND波段选股,0,100,1,0),COLORWHITE;
DRAWTEXT_FIX(1,0.005,0,0, 所属风格: ),COLORRED;
DRAWTEXT_FIX(1,0.06,0,0,FGBLOCK),COLORRED;
DRAWTEXT_FIX(1,0.005,0.06,0, 所属概念: ),COLORMAGENTA;
DRAWTEXT_FIX(1,0.06,0.06,0,GNBLOCK),COLORMAGENTA;
DRAWTEXT_FIX(1,0.005,0.12,0, 所属: ),COLORYELLOW;
DRAWTEXT_FIX(1,0.06,0.12,0,DYBLOCK),COLORYELLOW;
DRAWTEXT_FIX(1,0.11,0.12,0,HYBLOCK),COLORYELLOW;
YSTB:=STRCAT(CON2STR(FINANCE(44)/1,2), %
LRTB:=STRCAT(CON2STR(FINANCE(43)/1,2), %
DRAWTEXT_FIX(1,0.7,0,0, 营收同⽐: ),COLORWHITE;
DRAWTEXT_FIX(1,0.76,0,0,YSTB),COLORWHITE;
DRAWTEXT_FIX(1,0.84,0,0, 利润同⽐: ),COLORWHITE;
DRAWTEXT_FIX(1,0.9,0,0,LRTB),COLORWHITE;
净资收益率:=(FINANCE(33)/FINANCE(34)*100);
主营利润率:=(FINANCE(23)/FINANCE(20)*100);
主营业增长率:=FINANCE(44);
每股净资产:=CONST(FINANCE(34));
每股收益:=CONST(FINANCE(38));
净利润增长率:=FINANCE(43);
市销率:=CONST(FINANCE(1)*DYNAINFO(7)/FINANCE(20));
现⾦负债⽐:=(FINANCE(25)/FINANCE(15));
每股未分配:=CONST(FINANCE(32));
每股公积⾦:=CONST(FINANCE(18));
SY01:=净资收益率
SY02:=净资收益率 0.01AND净资收益率
SY03:=主营利润率
SY04:=主营利润率
SY05:=主营业增长率
SY06:=主营业增长率
SY07:=净利润增长率
SY08:=净利润增长率
SY09:=每股收益 0.01;
SY10:=每股收益 0.001;
SY11:=每股净资产
SY12:=每股净资产 0.01;
SY13:=每股未分配
SY14:=每股未分配 0.001;
SY15:=每股公积⾦
SY16:=每股公积⾦ 0.002;
SY17:=每股未分配 =2AND每股公积⾦
SY18:=每股未分配 2OR每股公积⾦
优秀:=SY01ANDSY03ANDSY05ANDSY07ANDSY09ANDSY11
ANDSY13ANDSY15;
较好:=SY02ANDSY04ANDSY06ANDSY08ANDSY10ANDSY12
ANDSY14ANDSY16;
⼀般:=NOT(优秀)ANDNOT(较好);
DRAWTEXT_FIX(优秀AND较好=0,0.7,0.05,0, 综合评估基本⾯:优秀! ),COLORMAGENTA;
DRAWTEXT_FIX(较好,0.7,0.05,0, 综合评估基本⾯:较好! ),COLORRED;
DRAWTEXT_FIX(⼀般,0.7,0.05,0, 综合评估基本⾯:⼀般! ),COLORGREEN;
DRAWTEXT_FIX(SY17,0.84,0.05,0, 是否具备⾼送转潜⼒:是! ),COLORMAGENTA;
DRAWTEXT_FIX(SY18,0.84,0.05,0, 是否具备⾼送转潜⼒:否! ),COLORGREEN;
MA5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20);
MA60:MA(CLOSE,60);
BB:=REF(INDEXC,1)=REF(C,1)ANDREF(O,1)/REF(C,1) =1.05
ANDREF(C,1)OANDC/O =1.05ANDC REF(O,1)
ANDREF(VOL,1)
STICKLINE(BB,O,C,4,0),COLORRED;
STICKLINE(BB,O,H,0,0),COLORRED;
STICKLINE(BB,L,C,0,0),COLORRED;
DRAWTEXT(BB,L*0.95, 追! ),COLORYELLOW;
VAR1:=4*SMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100,5,1)-
3*SMA(SMA((CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100,5,1),3.2,1);
VAR2:=8;
CC:=CROSS(VAR1,VAR2);
DRAWTEXT(CC,L*0.95, 买! ),COLORMAGENTA;
TYP:=(H+L+C)/3;
TYP1:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)) =20ANDREF(MA(C,21),1)
TJ1:=O
TJ2:=REF(C,1) =MA(C,21)ANDL/MA(C,21) =1.015ANDMA(C,144) MA(C,250)ANDVV;
TJ3:=REF(MA(C,250),90)MA(C,250)ANDO MA(C,250);
TJ4:=MAX(REF(H,10)ANDREF(H,9)ANDREF(H,8)ANDREF(H,7),REF(H,6));
TOUJI:=TYP1ANDTJ1ANDTJ2ANDREF(C,2)/REF(O,2) 1.06ANDC/O =1.05ANDHHV(H,5)/LLV(L,30) =1.65AND
REF(H,5)/REF(L,1) =1.15ANDREF(C,1)/REF(O,1) =0.995AND(L=2)ANDO/REF(L,1) =1.04
ORTYP1ANDTJ1ANDO/REF(L,1) 1.05ANDREF(L,1)/REF(O,4) =0.85ANDREF(C,1)/REF(O,1) =1.03ANDO1.35AND
V
TOUJI2:=TYP1ANDTJ1ANDTJ2ANDO/REF(L,1) 1.05ANDO/LLV(L,3) 1.1ANDREF(C,1)/REF(0,1) =1.05AND
HHV(H,4)/LLV(L,16) =1.35ANDREF(O,4)/REF(C,2) =1.08ANDREF(C,2)/REF(O,2) =0.995AND(REF(L,2)=2)ANDL
ORTYP1ANDTJ1ANDHHV(H,10)/LLV(L,25) =1.3ANDREF(C,5)
DATOUJI:=TYP1ANDTJ3ANDO=1.17ANDHHV(H,10)/LLV(L,30) 1.4AND(MA(V,10)/HHV(V,10) 0.5AND
V/HHV(V,10) 0.2ANDV/HHV(V,10) 0.4ORREF(V,3) REF(V,2)ANDREF(V,2) REF(V,1))ANDREF(C,1)/REF(C,2) =1.02;
DATOUJI1:=TYP1ANDTJ3ANDO
DRAWTEXT(TOUJIORTOUJI2ORDATOUJIORDATOUJI1,L*0.98, △ ),COLORYELLOW;
DRAWTEXT(CROSS(MA(VOL,10),MA(VOL,20))ANDMA(VOL,5) MA(VOL,10)ANDL=MA(C,20),L*0.98, 量
托 ),COLORWHITE;
卖出:=CROSS(90,SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100);
DRAWTEXT(卖出,H*1.05, 短卖 ),COLORGREEN;
C3:=REF(C,1);
涨停:=IF((C-C3)*100/C3 =(10-0.01*100/C3),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORRED;
跌停:=IF((C3-C)*100/C3 =(10-0.01*100/C3),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2 0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
盘整:=W4ANDCOUNT(W4,5)=1;
DRAWICON(突破盘整,L-0.10,1);
红轨道:=MA(MA(CLOSE,3),1),LINETHICK1,COLORYELLOW;
绿轨道:=MA(MA(CLOSE,3),3);
上升:IF(红轨道 =绿轨道,绿轨道,DRAWNULL),COLORRED,LINETHICK2;
AA1:=3*SMA((C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100,3,1)-2*SMA(SMA((C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100,3,1),3,1);
加仓:=IF(CROSS(AA1,REF(AA1+0.01,1))ANDLLV(AA1,2)=LLV(AA1,8)ANDBETWEEN(AA1,20,60),1,0);
波段底:=(3)*(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1))-
(2)*(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1),3,1));
DRAWICON(加仓,L*0.97,7);
DRAWICON(CROSS(波段底,3),L*0.97,1);
A:=(3*C+L+O+H)/6;
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+
14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
CB:=EMA(X,13);
卖:=IF(HHV(DX,2)=HHV(DX,7)ANDCOUNT(DX 50,2)ANDCROSS(MA(DX,2),DX),1,0);
DRAWTEXT(FILTER(卖=1,1),HIGH*1.02, 卖 ),COLORWHITE;
买:=IF(LLV(DX,2)=LLV(DX,7)ANDCOUNT(DX 0,2)ANDCROSS(DX,MA(DX,2)),1,0);
DRAWTEXT(FILTER(买=1,5),LOW-0.2, 买 ),COLORRED;
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
BDGD:=HHV(J,2)=HHV(J,8)ANDJ
注意:=IF(CROSS(REF(J-0.01,1),J)ANDREF(BDGD,1),1,0);
DRAWTEXT(注意AND卖!=1,HIGH*1.02, 减 ),COLORFFFF50;
加仓A:=SMA(EMA((C-REF(C,1))/REF(C,1),5)*100,3,1)*10;
DRAWTEXT(FILTER((CROSS(加仓A,0)ORCROSS(CLOSE,CB))AND买!=1,3),LOW-0.1, 加 ),COLOR0080FF;
MA18:=MA(C,18);
跟:=IF(MA18 =REF(MA18,3)ANDCROSS(CLOSE,MA18),1,0);
DRAWTEXT(MA18 =REF(MA18,3)ANDCROSS(CLOSE,MA18),LOW*0.96, 跟 ),COLOR7F52AF;
买价:=((C-REF(MA5,1))/5+MA5)*1.004;
买条件:=CROSS(C,买价)AND买价 REF(买价,1);
醉⽩K买进:IF(买条件,L,H),COLORWHITE,POINTDOT;
STICKLINE(买条件,H,L,0,1),COLORWHITE,LINETHICK2;
STICKLINE(买条件,O,C,4,1),COLORWHITE,LINETHICK2;
加码价:=((C-REF(MA10,1))/20+MA10)*1.004;
加码条件:=CROSS(C,加码价)AND加码价 REF(加码价,1);
醉黄K加码:IF(加码条件,L,H),COLORYELLOW,POINTDOT;
STICKLINE(加码条件,H,L,0,1),COLORYELLOW,LINETHICK2;
STICKLINE(加码条件,O,C,4,1),COLORYELLOW,LINETHICK2;
DRAWTEXT_FIX(1,0.0,0.15,0, 在上升过程中,⽩线出现在红线下⽅明显分开则卖出! ),COLORMAGENTA;