最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 飞狐专用VBS当日龙虎榜

    正文概述    2024-04-14 15:14:09  

    用VBS写的当日龙虎榜,纯习作。各位老师、童鞋,请勿拍砖
    数据来自网络,每天第一次使用该时,要有约一秒的数据下载时间
    指标显示要看网络的更新时间(网址,源码中有)
    数据存放在临时文件夹:C:/Windows/Temp/
    当日没有进入龙虎榜的,不会显示
    如不显示,请检查一下系统

    DRAWGBK(1, COLORRGB(0,0,0), COLORRGB(0,0,0),0);
    txts:='';
    <%
    path="C:/WINDOWS/Temp/龙虎榜.txt"
    Set fso = CreateObject("Scripting.FileSystemObject")
    if fso.fileexists(path) then
    Set f = fso.GetFile(path)
    md =DateValue(f.DateCreated)
    nd=date
    if md<>nd then
    wycp
    else
    end if
    else
    wycp
    end if
    Set F = fso.OpenTextFile(path,1)
    sub wycp
    url="http://data.10jqka.com.cn/market/longhud.html"
    set xhp=createobject("microsoft.xmlhttp")
    xhp.open "get",url,false
    xhp.send
    Set MyStream=CreateObject("Adodb.Stream")
    MyStream.Type = 1
    MyStream.Open
    MyStream.Write xhp.responseBody
    MyStream.SaveToFile path
    end sub
    %>
    Dz:='C:/WINDOWS/Temp/龙虎榜.txt';
    Wb:='';
    <%
    On Error Resume Next
    Dz=FFL.VarData("Dz")
    Set D_1 = CreateObject("Scripting.FileSystemObject")
    Set D_a = D_1.OpenTextFile(Dz, 1)
    Wb= D_a.ReadAll & ""
    Wb=replace(Wb,"""","")
    Wb=replace(Wb,"","")
    Wb=replace(Wb,"
    ","")
    Wb=replace(Wb,"","")
    Wb=replace(Wb,"","")
    Wb=replace(Wb,"","")
    D_a.Close
    FFL.VarData("Wb")=Wb
    %>
    A0:=STRFIND(Wb,'/'+STKLABEL+'/',1);
    A01:=STRFIND(Wb,'查看明细',A0+10);
    A02:=STRFIND(Wb,'买卖净差',A01+10);
    IF A0>0 THEN BEGIN
    A1:=STRFIND(Wb,'当日总成交量:',A0+1);
    A2:=STRFIND(Wb,'
    ',A1+1);
    A3:=STRFIND(Wb,'总成交金额:',A2+1);

    B4:=STRFIND(Wb,'买入总计',A3+1);
    B5:=STRFIND(Wb,'class=yrq1 pr10 FB>',B4+1);
    B6:=STRFIND(Wb,'',B5+1);

    D4:=STRFIND(Wb,'卖出总计',A3+1);
    D5:=STRFIND(Wb,'class=yrq1 pr10 FB>',D4+1);
    D6:=STRFIND(Wb,'',D5+1);

    E4:=STRFIND(Wb,'买卖净差',A3+1);
    E5:=STRFIND(Wb,'class=yrq1 pr10 FB>',E4+1);
    E6:=STRFIND(Wb,'',E5+1);
    A4:=STRFIND(Wb,'',A3+1);
    龙虎:A0>0,LINETHICK0;
    占比:STRTONUM(STRMID(Wb,E5+19,E6-E5-19))/STRTONUM(STRMID(Wb,A3+12,A4-A3-16))*100,LINETHICK0,PRECISION2;
    净差:STRTONUM(STRMID(Wb,E5+19,E6-E5-19)),LINETHICK0,PRECISION2,ColorFFFF00;
    买入:STRTONUM(STRMID(Wb,B5+19,B6-B5-19)),LINETHICK0,PRECISION2,Color0000FF;
    卖出:STRTONUM(STRMID(Wb,D5+19,D6-D5-19)),LINETHICK0,PRECISION2,Color00FF00;
    A5:=STRFIND(Wb,'class=lhyybcx>',A4+1);
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);

    DRAWTEXTEX(1,0, 30, 0,STKLABEL+' '+STKNAME+' '+STRMID(Wb,A1,A2-A1)),Color7FFDFF;
    DRAWTEXTEX(1,0,470, 0,STRMID(Wb,A3,A4-A3)),align2,Color7FFDFF;
    DRAWTEXTEX(1,0, 6, 15,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 15,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 15,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;

    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6, 30,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 30,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 30,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6, 45,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 45,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 45,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6, 60,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 60,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 60,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6, 75,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 75,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 75,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6, 90,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420, 90,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500, 90,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6,105,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420,105,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500,105,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6,120,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420,120,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500,120,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6,135,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420,135,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500,135,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    A5:=STRFIND(Wb,'class=lhyybcx>',A10+1);
    IF A02>A5 THEN BEGIN
    A6:=STRFIND(Wb,'',A5+1);
    A7:=STRFIND(Wb,'class=yrq1 pr10>',A6+1);
    A8:=STRFIND(Wb,'',A7+1);
    A9:=STRFIND(Wb,'class=yrq1 pr10>',A8+1);
    A10:=STRFIND(Wb,'',A9+1);
    DRAWTEXTEX(1,0, 6,150,STRMID(Wb,A5+14,A6-A5-14)),ColorFFFF00;
    DRAWTEXTEX(1,0,420,150,STRMID(Wb,A7+16,A8-A7-16)),align2,Color0000FF;
    DRAWTEXTEX(1,0,500,150,STRMID(Wb,A9+16,A10-A9-16)),align2,Color00FF00;
    END;
    END;


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 飞狐专用VBS当日龙虎榜 加入收藏