通达信多指标合成主图指标公式

[复制链接]
查看76 | 回复0 | 2021-8-20 20:03:18 | 显示全部楼层 |阅读模式
本文指标含有选股公式如下:

多指标合成主图之红球选股指标公式

多指标合成主图之见底选股指标公式

多指标合成主图之笑脸选股指标公式

多指标合成主图之三色球选股指标公式

JJJ:=IF(DYNAINFO(8)>0.01,0.01*DYNAINFO(10)/DYNAINFO(8),DYNAINFO(3));
DDD:=(DYNAINFO(5)<0.01 || DYNAINFO(6)<0.01);
JJJT:=IF(DDD,1,(JJJ<(DYNAINFO(5)+0.01) && JJJ>(DYNAINFO(6)-0.01)));
CYC3:IF(JJJT,0.01*EMA(AMOUNT,3)/EMA(VOL,3),EMA((HIGH+LOW+CLOSE)/3,3));
CYC5:IF(JJJT,0.01*EMA(AMOUNT,5)/EMA(VOL,5),EMA((HIGH+LOW+CLOSE)/3,5));
DRAWBAND(CYC3,RGB(230,0,50),CYC5,RGB(00,50,250));
CYC34:IF(JJJT,0.01*EMA(AMOUNT,34)/EMA(VOL,34),EMA((HIGH+LOW+CLOSE)/3,34)),COLORGREEN,LINETHICK2;
IF(CYC34>REF(CYC34,1),CYC34,DRAWNULL),COLORMAGENTA,LINETHICK2;
DRAWKLINE(H,O,L,C);
{涨停K线}
ZT:=REF(C,1)*1.1-C<0.01 AND H=C;
突破:=ZT;
STICKLINE(突破,C,O,3,0),COLOR000088;
STICKLINE(突破,C,O,2.5,0),COLOR000099;
STICKLINE(突破,C,O,2,0),COLOR0000AA;
STICKLINE(突破,C,O,1.5,0),COLOR0000BB;
STICKLINE(突破,C,O,1.0,0),COLOR0000DD;
STICKLINE(突破,C,O,0.5,0),COLOR0000FF;{//红柱}
STICKLINE(突破,C,O,0.5,0),COLORMAGENTA;
B:=SMA(CLOSE,20,1)*2-REF(SMA(CLOSE,20,1),1);
分水岭:=SMA(IF(MA(CLOSE,20)<B,B,MA(CLOSE,20)),3,1);
操作线:SMA(分水岭-(MA(C,5)-分水岭),2,1),COLORLIMAGENTA,LINETHICK1;
OUTF:=CROSS(CYC5,操作线);
DRAWICON(OUTF,操作线,13);
AC:=(2*C+H+L)/4;
M25:=MA(AC,25);
UB:M25+2*STD(AC,25),COLORYELLOW,DOTLINE;
LB:M25-2*STD(AC,25),COLORYELLOW,DOTLINE;
VAR1:=CLOSE-LOW;
VAR2:=HIGH-LOW;
VAR3:=CLOSE-HIGH;
VAR4:=IF(HIGH>LOW,(VAR1/VAR2+VAR3/VAR2)*VOL,0);
HPTP:=SUM(VAR4,10)/10000,COLORSTICK;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
TKXL:=(DIF-DEA)*2;
XVYO:=UPNDAY(TKXL,1);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5);
FD01:=BACKSET(LL,6)>BACKSET(LL,5);
{STICKLINE(V/REF(V,1)>2,OPEN,CLOSE,1,0),COLOR00FFFF;}
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND MA(C,5)>MA(C,10),FG01,IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND MA(C,10)>MA(C,5),FD01,IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1)));
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
NN:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
UU:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
趋势向上:=DRAWLINE(UU,L,NN,H,0),COLORYELLOW,DOTLINE;
趋势向下:=DRAWLINE(NN,H,UU,L,0),COLORWHITE,DOTLINE;
找顶线:DRAWLINE(NN,H,REF(NN,1),REF(H,1),1),COLORLIBLUE,LINETHICK1;
找底线:DRAWLINE(UU,L,REF(UU,1),REF(L,1),1),COLORMAGENTA,LINETHICK1;
DRAWNUMBER(UU,L*0.995,L);
DRAWNUMBER(NN,H*1.01,H);
XG:CROSS(C,找顶线) AND 找顶线>0 AND HPTP AND XVYO,NODRAW;
DRAWICON(XG,LOW,1);
DRAWTEXT(ISLASTBAR,找顶线,VAR2STR(找顶线,2)),COLORGREEN;
DRAWTEXT(ISLASTBAR,找底线,VAR2STR(找底线,2)),COLORMAGENTA;
TJ1:=VOL=HHV(VOL,10) AND VOL>2*REF(VOL,1) AND CLOSE>O;
立桩量:=FILTER(TJ1,0);
TJ2:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(HIGH,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(HIGH,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(HIGH,3),1,0)));
STICKLINE(CLOSE,REF(LOW,BARSLAST(立桩量)),REF(LOW,BARSLAST(立桩量)),2,0),COLORYELLOW;
{STICKLINE(CLOSE,REF(HIGH,BARSLAST(立桩量)),REF(HIGH,BARSLAST(立桩量)),2,0),COLORGREEN;}
STICKLINE(立桩量,O,C,0.5,0),COLORYELLOW;
A1:=C>REF(C,4);
NT:=BARSLASTCOUNT(A1);
TJ11:=NT=9;
TJ13:=ISLASTBAR AND BETWEEN(NT,1,8);
AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
DRAWTEXT(AY>0,H*1.02,VAR2STR(AY,0)),COLORFF00FF;
DRAWTEXT(NT=9,H*1.02,'9'),COLORGREEN;
BA1:=C<REF(C,4);
NT0:=BARSLASTCOUNT(BA1);
TJ21:=NT0=9 ;
TJ23:=ISLASTBAR AND BETWEEN(NT0,1,8);
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;
DRAWTEXT(AY1>0,L*0.98,VAR2STR(AY1,0)),COLORGREEN;
DRAWTEXT(NT0=9,L*0.98,'9'),COLORFF00FF;
LC:=REF(CLOSE,1);
RSI:SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,NODRAW;
DRAWTEXT(CROSS(80,RSI) ,HIGH*1.01,'见顶'),COLORYELLOW;
DRAWTEXT(CROSS(RSI,20),LOW*0.992,'见底'),COLORWHITE;
RSVA:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K1:=SMA(RSVA,3,1)COLORWHITE;
D1A:=SMA(K1,3,1),COLORYELLOW;
J:=3*K1-2*D1A,COLORMAGENTA,LINETHICK2;
DRAWICON(CROSS(J,0),L+0.01,5);
DRAWICON(CROSS(100,J),H+0.03,4);
RSVB:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
KB:=SMA(RSVB,3,1),COLORWHITE,NODRAW;
DB:=SMA(KB,3,1),NODRAW;
JA:=3*KB-2*DB,COLORMAGENTA,LINETHICK2;
DRAWICON(CROSS(JA,0),L,18);
DRAWICON(CROSS(100,JA),H*1.005,15);
{STICKLINE(CROSS(JA,0),O,C,2,0),COLORYELLOW;}
STICKLINE(CROSS(JA,0),H,L,0,1),COLORYELLOW;
STICKLINE(CROSS(JA,0),C,O,3.0,0),COLOR117777;
STICKLINE(CROSS(JA,0),C,O,2.5,0),COLOR119999;
STICKLINE(CROSS(JA,0),C,O,2.0,0),COLOR11BBBB;
STICKLINE(CROSS(JA,0),C,O,1.5,0),COLOR11DDDD;
STICKLINE(CROSS(JA,0),C,O,1.0,0),COLOR44FFFF;
STICKLINE(CROSS(JA,0),CLOSE,OPEN,0.5,0),COLORMAGENTA;
STICKLINE(CROSS(100,JA),C,O,3,0),COLOR008800;
{STICKLINE(TGLXS<0,100,100+TGLXS,2.8,0),COLOR009900;}
STICKLINE(CROSS(100,JA),C,O,2.5,0),COLOR00AA00;
STICKLINE(CROSS(100,JA),C,O,2,0),COLOR00BB00;
{STICKLINE(TGLXS<0,100,100+TGLXS,1.8,0),COLOR00CC00;}
STICKLINE(CROSS(100,JA),C,O,1.5,0),COLOR00DD00;
{STICKLINE(TGLXS<0,100,100+TGLXS,1.2,0),COLOR00EE00;}
STICKLINE(CROSS(100,JA),C,O,1,0),COLOR00FF00;{//绿柱}
STICKLINE(CROSS(100,JA),O,C,0.5,0),COLORBLUE;
SAR1:SAR(10,2,20),COLORCYAN,NODRAW;
IF(SAR1>C,SAR1,DRAWNULL),COLORCYAN,CIRCLEDOT;
IF(SAR1<C,SAR1,DRAWNULL),COLORRED,CIRCLEDOT;
收盘线:DRAWLINE(CURRBARSCOUNT=TOTALBARSCOUNT,CONST(C),CURRBARSCOUNT=1,C,3),COLORBROWN,DOTLINE;
TM:=1200823;
涨停:IF(DATE<TM,ZTPRICE(REF(C,1),IF(CODELIKE('688'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1))),ZTPRICE(REF(C,1),IF(CODELIKE('688') OR CODELIKE('300'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1)))),NODRAW,COLORRED;
跌停:IF(DATE<TM,DTPRICE(REF(C,1),IF(CODELIKE('688'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1))),DTPRICE(REF(C,1),IF(CODELIKE('688') OR CODELIKE('300'),0.2,IF(NAMEINCLUDE('S'),0.05,0.1)))),NODRAW,COLORGREEN;
明涨停:IF(DATE<TM,C*IF(CODELIKE('688'),1.2,IF(NAMEINCLUDE('S'),1.05,1.1)),C*(IF(CODELIKE('688') OR CODELIKE('300'),1.2,IF(NAMEINCLUDE('S'),1.05,1.1)))),NODRAW,COLORLIMAGENTA;
明跌停:IF(DATE<TM,C*IF(CODELIKE('688'),0.8,IF(NAMEINCLUDE('S'),0.45,0.9)),C*(IF(CODELIKE('688') OR CODELIKE('300'),0.8,IF(NAMEINCLUDE('S'),0.45,0.9)))),NODRAW,COLORFFFF00;
所属板块:=STRCAT('所属板块: ',STRCAT(STRCAT(STRCAT('[行业]-',HYBLOCK),STRCAT(' [地域]-',DYBLOCK)),STRCAT(' [概念]-',GNBLOCK)));
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');
流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿');
全流通:=STRCAT(' 全流通: ',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');
股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值));
{业绩}
投资收益:=STRCAT(' 投资收益: ',CON2STR(FINANCE(24)*100,2));
净资收益率:=STRCAT(' 净资收益率: ',CON2STR(FINANCE(29)/FINANCE(19)*100,2));
毛利率:=STRCAT(' 毛利率: ',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
主营利润率:=STRCAT(' 主营利润率 ',CON2STR(FINANCE(23)/FINANCE(20)*100,2));
当前业绩:=STRCAT('当前业绩: ',STRCAT(STRCAT(净资收益率,毛利率),主营利润率));
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,所属板块),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.12,0,股本市值),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.18,0,当前业绩),COLORGREEN;
DRAWTEXT_FIX(1,0.005,0.24,0,'净利同比:'),COLOR99CC32;
DRAWNUMBER_FIX(1,0.055,0.24,0,CONST(FINANCE(43))),COLORYELLOW;
DRAWTEXT_FIX(1,0.112,0.24,0,'净利润:'),COLORWHITE;
DRAWNUMBER_FIX(1,0.157,0.24,0,CONST(FINANCE(30)/10000)),COLORFF00FF;
DRAWTEXT_FIX(1,0.005,0.30,0,'投资收益:'),COLORWHITE;
DRAWNUMBER_FIX(1,0.055,0.30,0,CONST(FINANCE(24)/1000000)),COLORFF00FF;
主营业增长率:=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:=净资收益率>3;
SY02:=净资收益率>0.01 AND 净资收益率<=3;
SY03:=主营利润率>2;
SY04:=主营利润率>0;
SY05:=主营业增长率>1;
SY06:=主营业增长率>0;
SY07:=净利润增长率>2;
SY08:=净利润增长率>0.2;
SY09:=每股收益>0.01;
SY10:= 每股收益>0.001;
SY11:=每股净资产>2;
SY12:=每股净资产>0.01;
SY13:=每股未分配>0.5;
SY14:=每股未分配>0.001;
SY15:=每股公积金>0.5;
SY16:=每股公积金>0.002;
SY17:=每股未分配>=2 AND 每股公积金>=2;
SY18:=每股未分配<2 OR 每股公积金<2;
优秀:=SY01 AND SY03 AND SY05 AND SY07 AND SY09 AND SY11
AND SY13 AND SY15;
较好:=SY02 AND SY04 AND SY06 AND SY08 AND SY10 AND SY12
AND SY14 AND SY16;
一般:=NOT(优秀) AND NOT(较好);
DRAWTEXT_FIX(优秀 AND 较好=0,0.45,0,0,'基本面:优秀!'),COLORMAGENTA;
DRAWTEXT_FIX(较好,0.45,0,0,'基本面:较好!'),COLORRED;
DRAWTEXT_FIX(一般,0.45,0,0,'基本面:一般!'),COLORGREEN;
DRAWTEXT_FIX(SY17,0.65,0,0,'高送转潜力:是!'),COLORMAGENTA;
DRAWTEXT_FIX(SY18,0.65,0,0,'高送转潜力:否!'),COLORGREEN;

202108201217.jpg

202108201217.jpg

 

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则