股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[大智慧] 大智慧F10提取


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-19 10:00:58
大智慧F10提取介绍

大智慧F10提取

{FXJ 可用}
cpbd:=f10find('☆[操盘必读]☆',1);
zxzb:=f10find('◆ 最新指标',cpbd+1);
zxsjsj:=f10find('◇万国测评制作',cpbd+1);
hydw:=f10find('◆ 行业地位 ◆',1000);
gxsj:=f10find('◇万国测评制作:',hydw);
zjsj:=f10text(gxsj,36);
{取行业}
hydw1:=f10find('所属行业:',hydw+1);
hydw3:=f10find('证监会行业:',hydw1+1);
hydw2:=f10find('截止日期:',hydw3+1);
{万国测评的资料是否完整,不完整就什么都不做}{文本数据不足,退出}
IF hydw1>0 and hydw3>0 and hydw2>0 THEN
BEGIN
zjh:=f10text(hydw3,hydw2-hydw3);{证监会描叙段}
hydw4:=f10find('共',hydw3+1);
js:=strtonum(f10text(hydw4+2,3));{取行业内企业家数}
{取时间}
sj:=f10text(hydw2,19);
{取每股收益排名}
mgsy:=f10find('每股收益 排名',hydw2+1);
mgsy1:=f10find('净资产收 排名',mgsy+1);
{wz:=mgsy+164;
FOR i=1 to js DO BEGIN
if pm=1 then break;
f10str:=f10text(wz,73);
dm:=strleft(f10str,15);
pm:=strtonum(strright(f10str,3));
wz:=wz+4+73;
END;}
gpszh:=f10find(STKLABEL,mgsy);
f10str:=f10text(gpszh,73);
dm:=strleft(f10str,15);
每股收益排:strtonum(strright(f10str,3)),linethick0,PRECIS2,colorgray;
{取净利润排名}
gpszh1:=f10find(STKLABEL,mgsy1);
f10str1:=f10text(gpszh1,73);
净利润排:strtonum(f10text(gpszh1+56,3)),linethick0,PRECIS2,colorgray;
{取主营收入及净资产收益率排名}
主营收入排:strtonum(f10text(gpszh+56,3)),linethick0,precis2,colorgray;
净资产收益排:strtonum(strright(f10str1,3)),linethick0,precis2,colorgray;
综合排名值:每股收益排+净利润排+主营收入排+净资产收益排,linethick0,precis2,colorff00a0;
{取最新净利润同比增长率、主营收入同比增长率及净资产收益率及数据时间}
zytb:=f10find('主营收入同比增长',cpbd+1);
主营收入同比:strtonum(f10text(zytb+20,10)),linethick0,PRECIS2,colorgray;
jll:=f10find('净利润同比增长',zytb+1);
净利润同比:strtonum(f10text(jll+20,10)),linethick0,PRECIS2,colorgray;
jzc:=f10find('净资产收益率',jll+1);
净资产收益率:strtonum(f10text(jzc+20,10)),linethick0,precis2,colorgray;
zxsj:=f10text(zxzb,zxsjsj-5-zxzb);
gxsjy:=f10text(zxsjsj,34);
{--------图解模版---------}
DRAWTEXTREL(350,10,zxsj+' '+gxsjy),ALIGN1,COLORRED;
DRAWTEXTREL(350,110,'主营收入同比增长 '+主营收入同比+' %'+' 净利润同比增长 '+净利润同比+' %'+' 净资产收益率 '+净资产收益率+' %'),ALIGN1,COLORRED;
DRAWTEXTREL(300,310,sj+' '+zjsj),ALIGN1,COLORRED;
DRAWTEXTREL(300,410,zjh),ALIGN1,COLORRED;
DRAWTEXTREL(350,510,'每股收益在本行业内排第 '+每股收益排+' 位 '+' 净利润金额在本行业内排第 '+净利润排+' 位'),ALIGN1,COLORRED;
DRAWTEXTREL(350,610,'主营收入在本行业内排第 '+主营收入排+' 位 '+' 净资产收益在本行业内排第 '+净资产收益排+' 位'),ALIGN1,COLORRED;
DRAWTEXTREL(500,810,dm+' 在本行业综合排名分值 '+综合排名值),ALIGN1,COLORff00a0,linethick4;
END;


{大智慧L2--万国F10资料提取}
F10:=IF(F10FIND('万国测评制作',1)>0,1,0);
HW1:=F10FIND('每股收益',50);
QSW:=F10FIND('◆ 控盘情况 ◆',500);
QSW1:=F10FIND('出]☆',1000)+120;
JSW1:=F10FIND('红]☆',QSW1+300)-80;
{F10数据查找}
IF F10=1 AND QSW>0 AND QSW1>0 AND JSW1>0 THEN{万国测评的资料是否完整,不完整就什么都不做}
BEGIN
{年报TIP}
f10str:=f10text(HW1,1024);
三季收益 := strmid(f10str,23-3,6);
HW2:=strfind(f10str,'每股净资产',1);
净资产:= strmid(f10str,HW2+22-3,6);
HW3:=strfind(f10str,'预计年报公布日' ,HW2+80);
if(HW3>0) then
begin
年报日:= strmid(f10str,HW3+18-3,10);
end;
{控盘情况数据栏数据提取}
f10str:=f10text(QSW,320);
WZ1:=strfind(f10str,'-',0)-4;
WZ2:=strfind(f10str,'-',WZ1+10)-4;
WZ3:=strfind(f10str,'-',WZ2+10)-4;
WZ4:=strfind(f10str,'-',WZ3+10)-4;
WZ5:=F10FIND('◆ 概念题材',WZ1);{查找结束位}
{取时间}
T1:= strmid(f10str,WZ1,10);
T2:= strmid(f10str,WZ2,10);
T3:=strmid(f10str,WZ3,10);
T4:= strmid(f10str,WZ4,10);
{取股东户数}
LS:=138;
HS1:=STRTONUM(strmid(f10str,WZ1+LS,10));
HS2:=IF(WZ2<WZ5,STRTONUM(strmid(f10str,WZ2+LS,10)),0);
HS3:=IF(WZ3<WZ5,STRTONUM(strmid(f10str,WZ3+LS,10)),0);
HS4:=IF(WZ4<WZ5,STRTONUM(strmid(f10str,WZ4+LS,10)),0);
{取户均持股数}
LS:=208;
RS1:=STRTONUM(strmid(f10str,WZ1+LS,10));
RS2:=IF(WZ2<WZ5 AND HS2>100,STRTONUM(strmid(f10str,WZ2+LS,10)),0);
RS3:=IF(WZ3<WZ5 AND HS3>100,STRTONUM(strmid(f10str,WZ3+LS,10)),0);
RS4:=IF(WZ4<WZ5 AND HS4>100,STRTONUM(strmid(f10str,WZ4+LS,10)),0);
{大股东数据查找}
f10str:=f10text(QSW1,JSW1-QSW1);
sjt:=f10find(' 占流通股 ',QSW1);
if STRTONUM(f10text(sjt-61,10))>0 then
TT1:=f10text(sjt-61,10);
else TT1:=f10text(sjt-22,10);
HJW:=f10find('总 计',sjt);
持股一:=strtonum(f10text(HJW+6,38));
if strtonum(f10text(HJW+45,5))=0 then
比例一:=持股一/CAPITAL*10000;
else
比例一:= strtonum(f10text(HJW+45,5));
sjt1:=f10find(' 占流通股 ',sjt+1);
if strtonum(f10text(sjt1-61,10))>0 then
TT2:=f10text(sjt1-61,10);
else TT2:=f10text(sjt1-22,10);
HJW1:=f10find('总 计',sjt1);
持股二:=strtonum(f10text(HJW1+6,38));
if strtonum(f10text(HJW1+45,5))=0 then
比例二:=持股二/CAPITAL*10000;
else
比例二:= strtonum(f10text(HJW1+45,5));
sjt2:=f10find(' 占流通股 ',sjt1+1);
if strtonum(f10text(sjt2-61,10))>0 then
TT3:=f10text(sjt2-61,10);
else TT3:=f10text(sjt2-22,10);
HJW2:=f10find('总 计',sjt2);
持股三:=strtonum(f10text(HJW2+6,38));
if strtonum(f10text(HJW2+45,5))=0 then
比例三:=持股三/CAPITAL*10000;
else
比例三:= strtonum(f10text(HJW2+45,5));
sjt3:=f10find(' 占流通股 ',sjt2+1);
if sjt3>0 and sjt3<jsw1 then begin
if strtonum(f10text(sjt3-61,10))>0 then
TT4:=f10text(sjt3-61,10);
else TT4:=f10text(sjt3-22,10);
HJW3:=f10find('总 计',sjt3);
持股四:=strtonum(f10text(HJW3+6,38));
if strtonum(f10text(HJW3+45,5))=0 then
比例四:=持股四/CAPITAL*10000;
else
比例四:= strtonum(f10text(HJW3+45,5));
end;
当期:=持股一;
当期1:=比例一;
上期:=持股二;
上期1:=比例二;
±比例:=当期1-上期1;
前二:=持股三;
前二1:=比例三;
前三:=持股四;
前三1:=比例四;
{将变化持股数对应显示在对应位置}
{排序}
股东增幅:(HS1-HS2)/HS2*100,PRECIS2,linethick0,Colorff00a0;
持股增幅:(RS1-RS2)/RS2*100,PRECIS2,linethick0,COLORRED;
主力增幅:(当期-上期)/上期*100,PRECIS2,LINETHICK0,Colorblue;
主力流通:(当期-上期1)/当期1*100,PRECIS2,LINETHICK0,Colorffcc00;
{-------------------【图解模板】-------------------}
A2:=0;
A3:=1000;
AG:=INTPART((A3-A2)/10);
{显示文字}
DRAWTEXTREL(0,AG*0,'报表时间'),COLORblue;
DRAWTEXTREL(0,AG*2,'户均持股'),Colorblue;
DRAWTEXTREL(0,AG*4,'股东户数'),Colorblue;
DRAWTEXTREL(0,AG*6,'主力占流通%'),Colorblue;
DRAWTEXTREL(0,AG*8,'主力持股数(万)'),Colorblue;
{时间}
DRAWTEXTREL(AG*8,AG*0,T1),ALIGN2,COLORred;
DRAWTEXTREL(AG*6,AG*0,T2),ALIGN2,COLORred;
DRAWTEXTREL(AG*4,AG*0,T3),ALIGN2,COLORred;
DRAWTEXTREL(AG*2,AG*0,T4),ALIGN2,COLORred;
{户均持股}
DRAWTEXTREL(AG*8,AG*2,NUMTOSTR(RS1 )),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*6,AG*2,NUMTOSTR(RS2 )),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*4,AG*2,NUMTOSTR(RS3 )),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*2,AG*2,NUMTOSTR(RS4 )),ALIGN2,Colorffcc00;
{股东户数}
DRAWTEXTREL(AG*8,AG*4,NUMTOSTR(HS1)),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*6,AG*4,NUMTOSTR(HS2)),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*4,AG*4,NUMTOSTR(HS3)),ALIGN2,Colorffcc00;
DRAWTEXTREL(AG*2,AG*4,NUMTOSTR(HS4)),ALIGN2,ColorFFcc00;
{主力占流通比}
temp:=NUMTOSTR(当期1);
tem:=TT1;
temp1:='('+tem+')'+temp;
DRAWTEXTREL(AG*8,AG*6,temp1),ALIGN2,COLORMAGENTA;
temp2:=NUMTOSTR(上期1);
tem2:=TT2;
temp3:='('+tem2+')'+temp2;
DRAWTEXTREL(AG*6,AG*6,temp3),ALIGN2,COLORMAGENTA;
temp4:=NUMTOSTR(前二1);
tem3:=TT3;
temp5:='('+tem3+')'+temp4;
DRAWTEXTREL(AG*4,AG*6,temp5),ALIGN2,COLORMAGENTA;
temp6:=NUMTOSTR(前三1);
tem4:=TT4;
temp7:='('+tem4+')'+temp6;
DRAWTEXTREL(AG*2,AG*6,temp7),ALIGN2,COLORMAGENTA;
{10大股东持股}
DRAWTEXTREL(AG*8,AG*8,NUMTOSTR(当期)),ALIGN2,COLORRED;
DRAWTEXTREL(AG*6,AG*8,NUMTOSTR(上期)),ALIGN2,COLORRED;
DRAWTEXTREL(AG*4,AG*8,NUMTOSTR(前二)),ALIGN2,COLORRED;
DRAWTEXTREL(AG*2,AG*8,NUMTOSTR(前三)),ALIGN2,COLORRED;
{TIP DRAW}
DRAWTEXTREL(AG*9,AG*6,'股收益:'+三季收益),ALIGN1,COLORRED;
DRAWTEXTREL(AG*9,AG*4,'净资产:'+净资产),ALIGN1,COLORRED;
DRAWTEXTREL(AG*9,AG*2,'年报日:'+年报日),ALIGN1,COLORRED;
{柱线}
{持股数柱线}
{STICKLINE(BARPOS=A3-AG*1-10 AND HS1>100,0,RS1,AG*3,1),LINETHICK2,ColorFFDDFF;
STICKLINE(BARPOS=A3-AG*2-15 AND HS2>100,0,RS2,AG*3,1),LINETHICK2,ColorF1FFB5;
STICKLINE(BARPOS=A3-AG*3-20 AND HS3>100,0,RS3,AG*3,1),LINETHICK2,ColorB9FFBC;
STICKLINE(BARPOS=A3-AG*4-25 AND HS4>100,0,RS4,AG*3,1),LINETHICK2,ColorB9FFFF;}
{10大股东画柱线}
{STICKLINE(BARPOS=A3-AG*1-6 AND 当期>0,0,当期,AG*3,0),LINETHICK2,ColorFFDDFF;
STICKLINE(BARPOS=A3-AG*2-11 AND 上期>0,0,上期,AG*3,0),LINETHICK2,ColorF1FFB5;
STICKLINE(BARPOS=A3-AG*3-16 AND 前二>0,0,前二,AG*3,0),LINETHICK2,ColorB9FFBC;
STICKLINE(BARPOS=A3-AG*4-21 AND 前三>0,0,前三,AG*3,0),LINETHICK2,ColorB9FFFF;}
END;



gd19898

回复

举报

QQ|

GMT+8, 2024-11-17 12:46

快速回复 返回顶部 返回列表