通达信【国9考核】副图指标 精品避雷首选 源码附图

{年份、报告期取值}
YYMMDD:=FINVALUE(0);{报告期0331,0630,0930,1231,假设:240331}
YY:=INTPART(YYMMDD/10000); {24}
YYYY:=YY+2000;{2024}
MMDD:=YYMMDD-YY*10000;{0331}
NF:=IF(MMDD=1231,YYYY,YYYY-1);{年份取值,如果=年报,是2024,否2023}

{财务数据变色}
净资产:=FINONE(72,NF,1231)/100000000;
净资产变色:=STRCAT(STRCAT('',VAR2STR(净资产,2)),' 亿');
DRAWTEXT_FIX(1,0.18,0.0,1,' 净资产:'),COLORGRAY;
DRAWTEXT_FIX(净资产>0,0.23,0.0,1,净资产变色),COLORGRAY;
DRAWTEXT_FIX(净资产<0,0.23,0.0,1,净资产变色),COLORLIGREEN;

总市值:=FINANCE(41)/100000000;{AB股总市值}
总市值变色:=STRCAT(STRCAT('',VAR2STR(总市值,2)),' 亿');
DRAWTEXT_FIX(1,0.18,0.15,1,' 总市值:'),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 总市值>5,0.23,0.15,1,总市值变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 总市值<5,0.23,0.15,1,总市值变色),COLORCYAN;
DRAWTEXT_FIX(FINANCE(3)=3 AND 总市值>3,0.23,0.15,1,总市值变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND 总市值<3,0.23,0.15,1,总市值变色),COLORCYAN;

营业收入:=FINONE(74,NF,1231)/100000000;{2023营业收入}
YYSN2:=FINONE(74,NF-1,1231)/100000000;{2022营业收入}
YYSN3:=FINONE(74,NF-2,1231)/100000000;{2021营业收入}
YYSNSUM:=(营业收入+YYSN2+YYSN3);{3年营业收入合计}
YYSNKH:=YYSNSUM*0.15;{3年营业收入15%}
营业收入变色:=STRCAT(STRCAT('',VAR2STR(营业收入,2)),' 亿');
DRAWTEXT_FIX(1,0.18,0.30,1,'营业收入:'), COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 营业收入>3,0.23,0.30,1,营业收入变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 营业收入<3,0.23,0.30,1,营业收入变色),COLORLIGREEN;
DRAWTEXT_FIX(FINANCE(3)=3 AND 营业收入>1,0.23,0.30,1,营业收入变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND 营业收入<1,0.23,0.30,1,营业收入变色),COLORLIGREEN;

利润总额:=FINONE(92,NF,1231)/100000000;
利润总额变色:=STRCAT(STRCAT('',VAR2STR(利润总额,2)),' 亿');
DRAWTEXT_FIX(1,0.35,0.0,1,' 利润总额:'),COLORGRAY;
DRAWTEXT_FIX(利润总额>0,0.4,0.0,1,利润总额变色),COLORGRAY;
DRAWTEXT_FIX(利润总额<0,0.4,0.0,1,利润总额变色),COLORRED;

归母净利润:=FINONE(96,NF,1231)/100000000;{2023归母净利润}
GMJLR2:=FINONE(96,NF-1,1231)/100000000;{2022归母净利润}
GMJLR3:=FINONE(96,NF-2,1231)/100000000;{2021归母净利润}
GMJLRSUM:=归母净利润+GMJLR2+GMJLR3;{3年归母净利润合计}
GMJLRKH:=GMJLRSUM/3*0.3;{年均归母净利润30%}
归母净利润变色:=STRCAT(STRCAT('',VAR2STR(归母净利润,2)),' 亿');
DRAWTEXT_FIX(1,0.35,0.3,1,'归母净利润:'),COLORGRAY;
DRAWTEXT_FIX(归母净利润>0,0.4,0.3,1,归母净利润变色),COLORGRAY;
DRAWTEXT_FIX(归母净利润<0,0.4,0.3,1,归母净利润变色),COLORLIRED;

扣非净利润:=FINONE(206,NF,1231)/100000000;
扣非净利润变色:=STRCAT(STRCAT('',VAR2STR(扣非净利润,2)),' 亿');
DRAWTEXT_FIX(1,0.35,0.15,1,'扣非净利润:'),COLORGRAY;
DRAWTEXT_FIX(扣非净利润>0,0.4,0.15,1,扣非净利润变色),COLORGRAY;
DRAWTEXT_FIX(扣非净利润<0,0.4,0.15,1,扣非净利润变色),COLORRED;

未分配利润:=FINONE(68,NF,1231)/100000000;
未分配利润变色:=STRCAT(STRCAT('',VAR2STR(未分配利润,2)),' 亿');
DRAWTEXT_FIX(1,0.35,0.45,1,' 未分配利润:'),COLORGRAY;
DRAWTEXT_FIX(未分配利润>0,0.4,0.45,1,未分配利润变色),COLORGRAY;
DRAWTEXT_FIX(未分配利润<0,0.4,0.45,1,未分配利润变色),COLORLIRED;

研发费用:=FINONE(304,NF,1231)/100000000;{2023研发费用}
YFFY2:=FINONE(304,NF-1,1231)/100000000;{2022研发费用}
YFFY3:=FINONE(304,NF-2,1231)/100000000;{2021研发费用}
YFFYSUM:=研发费用+YFFY2+YFFY3;{3年研发费用合计}
研发费用变色:=STRCAT(STRCAT('',VAR2STR(YFFYSUM,2)),' 亿');
DRAWTEXT_FIX(1,0.18,0.6,1,'累计研发:'), COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND YFFYSUM>=0,0.23,0.6,1,研发费用变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND YFFYSUM>3,0.23,0.6,1,研发费用变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND YFFYSUM<3,0.23,0.6,1,研发费用变色),COLORWHITE;

研发占比:=YFFYSUM/YYSNSUM*100;{创业板近三年累计研发占累计营业收入>15%}
研发占比变色:=STRCAT(STRCAT('',VAR2STR(研发占比,0)),' %');
DRAWTEXT_FIX(1,0.27,0.6,1,'');
DRAWTEXT_FIX(FINANCE(3)=1 AND 研发占比>=0,0.27,0.6,1,研发占比变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND 研发占比>15,0.27,0.6,1,研发占比变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND 研发占比<=15,0.27,0.6,1,研发占比变色),COLORWHITE;

{近3年累计分红}
ZJFHTS1:=SPLITBARS(0,1);{最新一次分红到今天的天数}
ZJFHTS2:=SPLITBARS(1,1);{上1次分红到今天的天数}
ZJFHTS3:=SPLITBARS(2,1);
ZJFHTS4:=SPLITBARS(3,1);
ZJFHTS5:=SPLITBARS(4,1);
ZJFHTS6:=SPLITBARS(5,1);
ZJFHTS7:=SPLITBARS(6,1);
ZJFHTS8:=SPLITBARS(7,1);
ZJFHTS9:=SPLITBARS(8,1)NODRAW;

ZJFH1:=CONST(SPLIT(0,1)*REF(FINANCE(1),ZJFHTS1+2))/100000000;
{最新一次分红的总额,后面加2的目的是怕分红同一天也扩股本,所以取分红前两天的股本来计算}
ZJFH2:=CONST(SPLIT(1,1)*REF(FINANCE(1),ZJFHTS2+2))/100000000;{上一次分红总额}
ZJFH3:=CONST(SPLIT(2,1)*REF(FINANCE(1),ZJFHTS3+2))/100000000;
ZJFH4:=CONST(SPLIT(3,1)*REF(FINANCE(1),ZJFHTS4+2))/100000000;
ZJFH5:=CONST(SPLIT(4,1)*REF(FINANCE(1),ZJFHTS5+2))/100000000;
ZJFH6:=CONST(SPLIT(5,1)*REF(FINANCE(1),ZJFHTS6+2))/100000000;
ZJFH7:=CONST(SPLIT(6,1)*REF(FINANCE(1),ZJFHTS7+2))/100000000;
ZJFH8:=CONST(SPLIT(7,1)*REF(FINANCE(1),ZJFHTS8+2))/100000000;
ZJFH9:=CONST(SPLIT(8,1)*REF(FINANCE(1),ZJFHTS9+2))/100000000;

YYYY1:=CONST(INTPART(REF(DATE+19000000,ZJFHTS1)/10000))NODRAW;{最新一次分红的年份}
YYYY2:=CONST(INTPART(REF(DATE+19000000,ZJFHTS2)/10000))NODRAW;{上一次分红的年份}
YYYY3:=CONST(INTPART(REF(DATE+19000000,ZJFHTS3)/10000))NODRAW;
YYYY4:=CONST(INTPART(REF(DATE+19000000,ZJFHTS4)/10000))NODRAW;
YYYY5:=CONST(INTPART(REF(DATE+19000000,ZJFHTS5)/10000))NODRAW;
YYYY6:=CONST(INTPART(REF(DATE+19000000,ZJFHTS6)/10000))NODRAW;
YYYY7:=CONST(INTPART(REF(DATE+19000000,ZJFHTS7)/10000))NODRAW;
YYYY8:=CONST(INTPART(REF(DATE+19000000,ZJFHTS8)/10000))NODRAW;
YYYY9:=CONST(INTPART(REF(DATE+19000000,ZJFHTS9)/10000))NODRAW;

D1NF:=INTPART(FINVALUE(0)/10000)+2000,NODRAW;
D2NF:=D1NF-1,NODRAW;
D3NF:=D1NF-2,NODRAW;

D1NFH:=IF(YYYY1=D1NF,ZJFH1,0)+IF(YYYY2=D1NF,ZJFH2,0)+IF(YYYY3=D1NF,ZJFH3,0)+IF(YYYY4=D1NF,ZJFH4,0),NODRAW;{第1年累计分红}
D2NFH:=IF(YYYY1=D2NF,ZJFH1,0)+IF(YYYY2=D2NF,ZJFH2,0)+IF(YYYY3=D2NF,ZJFH3,0)+IF(YYYY4=D2NF,ZJFH4,0)+IF(YYYY5=D2NF,ZJFH5,0)+IF(YYYY6=D2NF,ZJFH6,0)+IF(YYYY7=D2NF,ZJFH7,0)+IF(YYYY8=D2NF,ZJFH8,0),NODRAW;{第2年累计分红}
D3NFH:=IF(YYYY1=D3NF,ZJFH1,0)+IF(YYYY2=D3NF,ZJFH2,0)+IF(YYYY3=D3NF,ZJFH3,0)+IF(YYYY4=D3NF,ZJFH4,0)+IF(YYYY5=D3NF,ZJFH5,0)+IF(YYYY6=D3NF,ZJFH6,0)+IF(YYYY7=D3NF,ZJFH7,0)+IF(YYYY8=D3NF,ZJFH8,0)+IF(YYYY9=D3NF,ZJFH9,0),NODRAW;{第3年累计分红}

分红总额:=D1NFH+D2NFH+D3NFH,NODRAW;{最新3年累计分红}
分红总额变色:=STRCAT(STRCAT('',VAR2STR(分红总额,2)),' 亿');
DRAWTEXT_FIX(1,0.18,0.45,1,'累计分红:'), COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 分红总额>0.5,0.23,0.45,1,分红总额变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=1 AND 分红总额<0.5,0.23,0.45,1,分红总额变色),COLORRED;
DRAWTEXT_FIX(FINANCE(3)=3 AND 分红总额>0.3,0.23,0.45,1,分红总额变色),COLORGRAY;
DRAWTEXT_FIX(FINANCE(3)=3 AND 分红总额<0.3,0.23,0.45,1,分红总额变色),COLORRED;

分红占比:=分红总额/(GMJLRSUM/3)*100;{近三年累计分红<年均净利润30%}
分红占比变色:=STRCAT(STRCAT('',VAR2STR(分红占比,0)),' %');
DRAWTEXT_FIX(1,0.27,0.45,1,'');
DRAWTEXT_FIX(分红占比>=30,0.27,0.45,1,分红占比变色),COLORLIRED;
DRAWTEXT_FIX(分红占比<30,0.27,0.45,1,分红占比变色),COLORGRAY;

{新国九考核标准}
DRAWTEXT_FIX(1,0.42,0.00,0,'利润不合格:利润总额、扣非净利润、归母净利润三者孰低为负值。(仅利润不合格,不会被ST)'),COLORGRAY;
DRAWTEXT_FIX(1,0.42,0.15,0,'市值不合格:主板<5亿,创业板<3亿。注意:<市值不合格>或者<股价<1元>强制退市(连续20个交易日)。'),COLORGRAY;
DRAWTEXT_FIX(1,0.42,0.30,0,'营收不合格:主板<3亿,创业板<1亿(利润总额、扣非净利润、归母净利润三者孰低为负值)。或者 <净资产为负>'),COLORGRAY;
DRAWTEXT_FIX(1,0.42,0.45,0,'分红不合格:主板<5000万,创业板<3000万(近三年累计分红<年均净利润30%)(归母净利润、未分配利润为正)'),COLORGRAY;
DRAWTEXT_FIX(1,0.42,0.60,0,' 豁免条件:回购注销金额纳入现金分红金额计算(创业板近三年累计研发投入金额,>3亿或占累计营业收入>15%)'),COLORGRAY;

DNYYMMDD:=MACHINEDATE;{电脑日期,假设:1240501}
DN1YY:=INTPART(DNYYMMDD/10000);{124}
DNYY:=INTPART(DN1YY-100);{24}
DNYYYY:=INTPART((DNYYMMDD+19000000)/10000);{2024}

元旦:=DNYY*10000+1000101;{1240101}
今年已过天数:=DATETODAY(MACHINEDATE)-DATETODAY(元旦)+1;{24年已过天数}
年份考核:=(FINANCE(42)-今年已过天数)>2*365;{年份考核:3个会计年度}

主板分红考核:=年份考核=1 AND 未分配利润>0 AND 归母净利润>0 AND 分红总额<GMJLRKH AND 分红总额<0.5;{主板分红考核}
创业板分红考核:=年份考核=1 AND 未分配利润>0 AND 归母净利润>0 AND 分红总额<GMJLRKH AND 分红总额<0.3 AND YFFYSUM<3 AND YFFYSUM<YYSNKH;
{创业板分红考核,累计分红<年均净利润30%且低于3千万,累计研发费用<3亿,<累计营业收入15%}
分红考核不合格:=IF(FINANCE(3)=1,主板分红考核,IF(FINANCE(3)=3,创业板分红考核,DRAWNULL));

合格:=STRCAT('','合格');
不合格:=STRCAT('','不合格');
未满3年:=STRCAT('','未满3年');

DRAWTEXT_FIX(C>1,0.08,0.01,1,STRCAT('【利润考核】',':')),COLORGRAY;
DRAWTEXT_FIX((归母净利润>0)AND(利润总额>0)AND(扣非净利润>0),0.1,0.01,1,合格),COLORGRAY;
DRAWTEXT_FIX((归母净利润<0)OR(利润总额<0)OR(扣非净利润<0),0.11,0.01,1,不合格),COLORRED;

DRAWTEXT_FIX(C>1,0.08,0.15,1,STRCAT('【市值考核】',':')),COLORGRAY;
DRAWTEXT_FIX((FINANCE(3)=1 AND 总市值>5)OR(FINANCE(3)=3 AND 总市值>3),0.1,0.15,1,合格),COLORGRAY;
DRAWTEXT_FIX((FINANCE(3)=1 AND 总市值<5)OR(FINANCE(3)=3 AND 总市值<3),0.11,0.15,1,不合格),COLORCYAN;

DRAWTEXT_FIX(C>1,0.08,0.30,1,STRCAT('【营收考核】',':')),COLORGRAY;
DRAWTEXT_FIX((归母净利润>0)AND(利润总额>0)AND(扣非净利润>0)AND(净资产>0),0.1,0.30,1,合格),COLORGRAY;
DRAWTEXT_FIX(((FINANCE(3)=1 AND 营业收入>3)OR(FINANCE(3)=3 AND 营业收入>1))AND(净资产>0),0.1,0.30,1,合格),COLORGRAY;
DRAWTEXT_FIX((((归母净利润<0)OR(利润总额<0)OR(扣非净利润<0))AND(FINANCE(3)=1 AND 营业收入<3))OR(净资产<0),0.11,0.30,1,不合格),COLORLIGREEN;
DRAWTEXT_FIX((((归母净利润<0)OR(利润总额<0)OR(扣非净利润<0))AND(FINANCE(3)=3 AND 营业收入<1))OR(净资产<0),0.11,0.30,1,不合格),COLORLIGREEN;

DRAWTEXT_FIX(C>1,0.08,0.45,1,STRCAT('【分红考核】:',IF(分红考核不合格=1,'',''))),COLORGRAY;
DRAWTEXT_FIX(C>1,0.11,0.45,1,STRCAT('',IF(分红考核不合格=1,'不合格',''))),COLORRED;
DRAWTEXT_FIX(C>1,0.11,0.45,1,STRCAT('',IF(分红考核不合格=0 AND 年份考核=0,'不考核',''))),COLORYELLOW;
DRAWTEXT_FIX(C>1,0.11,0.45,1,STRCAT('',IF(分红考核不合格=0 AND 年份考核=1 AND (归母净利润<0 OR 未分配利润<0 OR 分红总额>=GMJLRKH),'不考核',''))),COLORLIRED;
DRAWTEXT_FIX(C>1,0.10,0.45,1,STRCAT('',IF(分红考核不合格=0 AND 年份考核=1 AND 归母净利润>0 AND 未分配利润>0 AND 分红总额<GMJLRKH,'合格',''))),COLORGRAY;

DRAWTEXT_FIX(C>1,0.08,0.60,1,STRCAT('【年份考核】',':')),COLORGRAY;
DRAWTEXT_FIX(((FINANCE(42)-今年已过天数)/365>=2),0.1,0.60,1,合格),COLORGRAY;
DRAWTEXT_FIX(((FINANCE(42)-今年已过天数)/365<2),0.11,0.60,1,未满3年),COLORYELLOW;

{扫雷宝变色}
安全分:=SAFESCORE;
扫雷宝:=STRCAT(STRCAT('【扫雷宝:',VAR2STR(安全分,0)),'分】');
DRAWTEXT_FIX(安全分>=80,0.4,0.60,1,扫雷宝),COLOR5DAF15;
DRAWTEXT_FIX(安全分<80 AND 安全分>=60,0.4,0.60,1,扫雷宝),COLORYELLOW;
DRAWTEXT_FIX(安全分<60,0.4,0.60,1,扫雷宝),COLORRED;



未来函数检测结果如下:
该公式包含未来函数:FINANCE
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  指标公式网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 浙ICP备2024071487号-2 指标公式网别名指标网仅为互联网文章,所有指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。指标公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图