以下是通达信财务主题主图指标公式源码和使用说明
通达信财务主题主图指标公式源码:
{CC:=IF(CURRBARSCOUNT 6,CONST(REF(H,1)),DRAWNULL);
止赢:1.05*CC,COLORMAGENTA,DOTLINE;
CCA:=IF(CURRBARSCOUNT 6,CONST(HHV(H,5)),DRAWNULL);
止损:0.9382*CCA,COLORYELLOW,DOTLINE;
必卖:0.9382*CC,COLORGREEN,DOTLINE;}
概念:=STRCAT(STRCAT(STRCAT(STRCAT(STRCAT('板块概念:',DYBLOCK),'-'),HYBLOCK),'-'),GNBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.005,0.01,0,'主题投资:'),COLORDDDDDD;
DRAWTEXT_FIX(ISLASTBAR,0.068,0.01,0,EXTERNSTR(0,1)),COLORDDDDDD;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,'主营业务:'),COLORDDDD66;
DRAWTEXT_FIX(ISLASTBAR,0.068,0.06,0,EXTERNSTR(0,2)),COLORDDDD66;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.12,0,板块概念),COLOR00DDDD;
DRAWTEXT_FIX(ISLASTBAR,0.005,0.18,0,'融胜主题:'),COLOR00DD00;
DRAWTEXT_FIX(ISLASTBAR,0.068,0.18,0,EXTERNSTR(0,3)),COLOR00DD00;
STICKLINE(MA(CLOSE,6) MA(CLOSE,33),MA(CLOSE,6),MA(CLOSE,33),6,0),COLOR000088;
STICKLINE(MA(CLOSE,6) MA(CLOSE,30),MA(CLOSE,6),MA(CLOSE,30),6,0),COLOR008800;
DRAWKLINE(H,O,L,C);
网1:EXPMA(CLOSE,5),COLORWHITE;
网2:EXPMA(CLOSE,12),COLORGRAY;
网3:EXPMA(CLOSE,33),COLORFF00FF,LINETHICK3;
IF(网3 REF(网3,1),网3,DRAWNULL),COLOR00FF00,LINETHICK3;
IF(网3 REF(网1,1),网1,DRAWNULL),COLORWHITE,LINETHICK1;
IF(网1 REF(网3,1),网1,DRAWNULL),COLORGREEN,LINETHICK1;
日:=50;昨前:=3;
高1:=REF(HHV(H,日),昨前);
低1:=REF(LLV(L,日),昨前);
H1:=高1-(高1-低1)*0.191;
H2:=高1-(高1-低1)*0.382;
H3:=高1-(高1-低1)*0.5;
H4:=高1-(高1-低1)*0.618;
H5:=高1-(高1-低1)*0.809;
L1:=低1+(高1-低1)*1.191;
L2:=低1+(高1-低1)*1.382;
L3:=低1+(高1-低1)*1.5;
L4:=低1+(高1-低1)*1.618;
L5:=低1+(高1-低1)*1.809;
短压:REFDATE(高1,DATE),COLORGREEN,LINETHICK1;
支撑19.1%:REFDATE(H1,DATE),COLORYELLOW;
支撑38.2%:REFDATE(H2,DATE),COLORMAGENTA;
支撑50%:REFDATE(H3,DATE),COLORLIGRAY;
支撑61.8%:REFDATE(H4,DATE),COLORWHITE,LINETHICK1;
支撑80.9%:REFDATE(H5,DATE),COLORWHITE;
低:REFDATE(低1,DATE),COLORWHITE;
阻力119.1%:REFDATE(L1,DATE),COLORYELLOW;
阻力138.2%:REFDATE(L2,DATE),COLORMAGENTA;
阻力150%:REFDATE(L3,DATE),COLORLIGRAY;
阻力161.8%:REFDATE(L4,DATE),COLORRED;
阻力180.9%:REFDATE(L5,DATE),COLORWHITE;
{提示}
DRAWTEXT(ISLASTBAR,短压,'短压'),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,低,低,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,短压,短压,1000,-1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=1,支撑19.1%,支撑19.1%,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,支撑38.2%,支撑38.2%,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,支撑50%,支撑50%,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,支撑61.8%,支撑61.8%,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,支撑80.9%,支撑80.9%,1000,-1),COLORWHITE;
STICKLINE(CURRBARSCOUNT=1,阻力119.1%,阻力119.1%,1000,-1),COLORYELLOW;
{三线显示钱袋子的源码}
DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA1:=EMA(DIFF1,9);
MACDD:=CROSS(DIFF1,DEA1);
1:=CROSS(MA(C,5),MA(C,10));
量线1:=CROSS(MA(V,5),MA(V,10));
DRAWICON(MACDDAND均线1AND量线1,L-0.20,25);{同时金叉显示25号图标};
DRAWICON(均线1AND量线1,L-0.20,1);
DRAWTEXT(量线1,L-0.25,'网量'),COLORYELLOW;
{判断}
JJ:=(CLOSE+HIGH+LOW)/3;
A:=EMA(JJ,7);
B:=REF(A,1);
STICKLINE(A B,A,B,2,0),COLORYELLOW;
STICKLINE(A B,A,B,2,0),COLORGREEN;
DRAWTEXT_FIX(1,0.00,0,0,HYBLOCK)COLOR0080FF;
DRAWTEXT_FIX(1,0.14,0,0,DYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.06,0,EXTERNSTR(0,1))COLOR0000FF;
DRAWTEXT_FIX(1,0.00,0.12,0,EXTERNSTR(0,2))COLORFF00FF;
DRAWTEXT_FIX(1,0.00,0.18,0,EXTERNSTR(0,3))COLORFF88FF;
DRAWTEXT_FIX(1,0.00,0.24,0,EXTERNSTR(0,5)),COLORLICYAN;
{均线}
ma5:MA(CLOSE,5);
MA10:MA(CLOSE,10);
MA20:MA(CLOSE,20);
MA60:MA(CLOSE,60);
MA120:MA(CLOSE,120),COLORFF972F;
金叉:=crOSS(MA5,MA10);
DRAWTEXT(金叉,MA10*0.99,'←金叉买'),COLORYELLOW;
二金叉:=CROSS(MA10,MA20);
DRAWTEXT(二金叉,MA20*0.98,'←二金叉加仓'),COLOR1880FF;
{无穷}
无穷:DMA(CLOSE,()/(CAPITAL));
XG:=CROSS(C,无穷)ANDV REF(V,1)*1.618;
stICKLINE(C/REF(C,1) 1.095,C,O,2,0),COLORMAGENTA;
STICKLINE(C/REF(C,1) 0.95,C,O,2,0),COLORGREEN;
{支撑压力}
N:=(H+L+C)/3;
明1压:2*N-L,LINETHICK0,NODRAW;
明1支:2*N-H,LINETHICK0,NODRAW;
明2压:N+H-L,LINETHICK0,NODRAW;
明2支:N-H+L,LINETHICK0,NODRAW;
{乖离}
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);
DRAWTEXT(CROSS(BIAS,乖离)AND乖离 -9.5,L*0.95,'↖红柱'),COLORRED;
{kd}
K:=(C+H+L)/3;D:=MA(K,4);
DRAWTEXT(REF(C,1) DANDC DANDD REF(D,1),H*1.02,'←卖'),COLORYELLOW;
DRAWTEXT(REF(C,1) DANDC DANDD REF(D,1)ANDC REF(C,1)*1.045,L*0.98,'←买'),COLORMAGENTA;
HH:=CONST(HHV(H,160));
LL:=CONST(LLV(L,160));{160可改成你习惯锁定的日数}
HL1:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.76,0.04));
HL2:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.80,0.08));
HL3:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.84,0.12));
HL4:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.88,0.16));
HL5:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.92,0.20));
HL6:=CONST(IF(CONST(REF(MA(C,10),10)) CONST((HH+LL)/2),0.96,0.24));
DRAWTEXT_FIX(1,0.00,0,0,'所属行业:')COLOR0080FF;
DRAWTEXT_FIX(1,0.07,0,0,HYBLOCK)COLOR0080FF;
DRAWTEXT_FIX(1,0.14,0,0,'所属地区:')COLOR00FFFF;
DRAWTEXT_FIX(1,0.21,0,0,DYBLOCK)COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0.06,0,'主题投资:')COLOR0000FF;
DRAWTEXT_FIX(1,0.07,0.06,0,EXTERNSTR(0,1))COLOR0000FF;
DRAWTEXT_FIX(1,0.00,0.12,0,'财务分折:')COLORMAGENTA;
DRAWTEXT_FIX(1,0.07,0.06,0,EXTERNSTR(0,1))COLOR0000FF;
{股本市值}
总股本:=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('上市天数:',CON2STR(FINANCE(42),0));
{上市日期:=STRCAT('上市日期:',CON2STR(HHV((BARSCOUNT(C)=0)*(DATE+19000000),0),0));}
股本市值:=STRCAT('股本市值:',STRCAT(STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值),上市天数));
{业绩综合}
市盈率:=STRCAT('市盈率:',CON2STR(C/FINANCE(33),2));
市销率:=STRCAT('市销率:',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));
市净率:=STRCAT('市净率:',CON2STR(C/FINANCE(34),2));
净资收益率:=STRCAT('净资收益率:',CON2STR(FINANCE(33)/FINANCE(34)*100,2));
毛利率:=STRCAT('毛利率:',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));
净利润率:=STRCAT('净利润率',CON2STR(FINANCE(30)/FINANCE(20)*100,2));
主营利润率:=STRCAT('主营利润率',CON2STR(FINANCE(23)/FINANCE(20)*100,2));
当前业绩:=STRCAT('当前业绩:',STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(市盈率,市销率),市净率),净资收益率),毛利率),净利润率),主营利润率));
{风险系数}
X1:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;
X2:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;{盈余公积用资本公积金代替};
X3:=FINANCE(23)/FINANCE(10)*3.3;
X4:=FINANCE(19)/FINANCE(15)*0.6;{缺长期负债或负债总额}
X5:=FINANCE(20)/FINANCE(15)*0.999;
Z值:=X1+X2+X3+X4+X5;
预警:=IF(Z值 1.2,'重警',IF(Z值 =1.2ANDZ值 2.6,'轻警','无警'));
财务预警:=STRCAT('财务预警:',STRCAT(预警,STRCAT('-Z值:',CON2STR(Z值,3))));
优质资产率:=STRCAT('优质资产率:',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));{理论上越大越好但不同行业有不同标准};
现金负债比:=STRCAT('现金负债比:',CON2STR(FINANCE(25)/FINANCE(15),3));{缺长期负债或负债总额,理论上越大越好但不同行业有不同标准};
财务系数:=STRCAT('风险系数:',STRCAT(STRCAT(财务预警,优质资产率),现金负债比));
{财务分折}
DRAWTEXT_FIX(1,0.05,0.12,0,'现金流:'),COLOR00CCCC;
DRAWNUMBER_FIX(1,0.086,0.12,0,CONST(FINANCE(25)/1000000000)),COLOR00CCCC;
DRAWTEXT_FIX(1,0.125,0.12,0,'应收款:'),COLOR00CCCC;
DRAWNUMBER_FIX(1,0.159,0.12,0,CONST(FINANCE(22)/100000000)),COLOR00CCCC;
DRAWTEXT_FIX(1,0.193,0.12,0,'存货:'),COLOR00CCCC;
DRAWNUMBER_FIX(1,0.218,0.12,0,CONST(FINANCE(27)/100000000)),COLOR00CCCC;
DRAWTEXT_FIX(1,0.253,0.12,0,'流动比率:'),COLOR00CCCC;{流动比率值 1.5 2.5较为合理,低于1说明偿债能力欠佳。}
DRAWNUMBER_FIX(1,0.299,0.12,0,CONST(FINANCE(11)/FINANCE(15))),COLOR00CCCC;
DRAWTEXT_FIX(1,0.336,0.12,0,'速动比率:'),COLOR00CCCC;
DRAWNUMBER_FIX(1,0.383,0.12,0,CONST(FINANCE(11)-FINANCE(27)/FINANCE(15))),COLOR00CCCC;
DRAWTEXT_FIX(1,0.47,0.12,0,'套牢盘%:'),COLOR00CCCC;
DRAWNUMBER_FIX(1,0.507,0.12,0,CONST(100-WINNER(CLOSE)*100)),COLOR00CCCC;
DRAWTEXT_FIX(1,0.348,0.30,0,'流动债:'),COLORGREEN;
DRAWNUMBER_FIX(1,0.385,0.30,0,CONST(FINANCE(15)/100000000)),COLORGREEN;
DRAWTEXT_FIX(1,0.426,0.30,0,'长期债:'),COLORGREEN;
DRAWNUMBER_FIX(1,0.463,0.30,0,CONST(FINANCE(16)/100000000)),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.00,0.18,0,股本市值),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.00,0.24,0,当前业绩),COLORGREEN;
DRAWTEXT_FIX(ISLASTBAR,0.00,0.30,0,财务系数),COLORGREEN;
通达信财务主题主图指标公式截图