最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 将{波段幅度}改为同花顺主图

    正文概述    2024-04-14 08:12:16  

    九毛八公式指标

    公式模块:

    请老师看看这个源码能否改成同花顺主图,辛苦啦!
    {波段幅度测幅工具----源码(待完善):}
    a1:=zig(3,8); {设定波段,3为收盘价。要准确判断波段,必须使用这个zig函数}
    a2:=last(a1>ref(a1,1)); {波段上涨天数}
    a3:=last(a1<ref(a1,1)); {波段下跌天数}
    tt1:=peak(1,8,1); {向前数第一个波峰的值,括号中第一个1表示以最高价作为波峰。这里是用这个波峰值作为这个波段的顶}
    bb1:=trough(2,8,1); {向前数第一个波谷的值,括号中的2表示以最低价作为波谷。这里以这个波谷的值作为这个波段的底}
    H1:=tt1-(tt1-bb1)*0.1; {设定波段从顶部落下来时,落下的幅度位置,H1是落下10%的位置。以下依此类推}
    H2:=tt1-(tt1-bb1)*0.2;
    H3:=tt1-(tt1-bb1)*0.3;
    H4:=tt1-(tt1-bb1)*0.4;
    H5:=tt1-(tt1-bb1)*0.5;
    H6:=tt1-(tt1-bb1)*0.6;
    H7:=tt1-(tt1-bb1)*0.7;
    L1:=bb1+(tt1-bb1)*0.1; {设定波段从底部涨上去时,上涨的幅度位置,L1是上涨10%的位置。以下依此类推}
    L2:=bb1+(tt1-bb1)*0.2;
    L3:=bb1+(tt1-bb1)*0.3;
    L4:=bb1+(tt1-bb1)*0.4;
    L5:=bb1+(tt1-bb1)*0.5;
    L6:=bb1+(tt1-bb1)*0.6;
    L7:=bb1+(tt1-bb1)*0.7;
    stickline(a3>0,tt1,tt1,8,0),linethick2,colorred; {画波段顶}
    stickline(a2>0,bb1,bb1,8,0),linethick2,colorred; {画波段底}
    stickline(a3>0,H1,H1,8,0),linethick0,colorFFFFCC; {波段下跌,在H1位置标记"-"。以下类推。}
    stickline(a3>0,H2,H2,8,0),linethick0,colorFFFFCC; {接上行:因为没有在主图画水平线的函数,所以用一系列的“-”来画出水平线}
    stickline(a3>0,H3,H3,8,0),linethick0,colorFFFFCC;
    stickline(a3>0,H4,H4,8,0),linethick0,colorFFFFCC;
    stickline(a3>0,H5,H5,8,0),linethick0,colorFFFFCC;
    stickline(a3>0,H6,H6,8,0),linethick0,colorFFFFCC;
    stickline(a3>0,H7,H7,8,0),linethick0,colorFFFFCC;
    drawtext(a3=1,H1,'10%'),linethick0,colorFFFFCC; {波段下跌,在H1位置标记"10%"。以下类推。}
    drawtext(a3=1,H2,'20%'),linethick0,colorFFFFCC; {接上行:在波段下跌第一天处,标注幅度值,看起来一目了然}
    drawtext(a3=1,H3,'30%'),linethick0,colorFFFFCC;
    drawtext(a3=1,H4,'40%'),linethick0,colorFFFFCC;
    drawtext(a3=1,H5,'50%'),linethick0,colorFFFFCC;
    drawtext(a3=1,H6,'60%'),linethick0,colorFFFFCC;
    drawtext(a3=1,H7,'70%'),linethick0,colorFFFFCC;
    stickline(a2>0,L1,L1,8,0),linethick0,colorFFFFCC; {波段上涨,在L1位置标记"-"。以下类推。}
    stickline(a2>0,L2,L2,8,0),linethick0,colorFFFFCC;
    stickline(a2>0,L3,L3,8,0),linethick0,colorFFFFCC;
    stickline(a2>0,L4,L4,8,0),linethick0,colorFFFFCC;
    stickline(a2>0,L5,L5,8,0),linethick0,colorFFFFCC;
    stickline(a2>0,L6,L6,8,0),linethick0,colorFFFFCC;
    stickline(a2>0,L7,L7,8,0),linethick0,colorFFFFCC;
    drawtext(a2=1,L1*1.015,'10%'),linethick0,colorFFFFCC; {波段上涨,在L1*1.015位置标记"10%"。以下类推。}
    drawtext(a2=1,L2*1.015,'20%'),linethick0,colorFFFFCC; {接上行:在波段上涨第一天处,标注幅度值,看起来一目了然}
    drawtext(a2=1,L3*1.015,'30%'),linethick0,colorFFFFCC;
    drawtext(a2=1,L4*1.015,'40%'),linethick0,colorFFFFCC;
    drawtext(a2=1,L5*1.015,'50%'),linethick0,colorFFFFCC;
    drawtext(a2=1,L6*1.015,'60%'),linethick0,colorFFFFCC;
    drawtext(a2=1,L7*1.015,'70%'),linethick0,colorFFFFCC; a1:=ZIG(3,8); //{设定波段,3为收盘价。要准确判断波段,必须使用这个zig函数}
    a2:=BArslAST(a1<REF(a1,1)); //{波段上涨天数}
    a3:=BARSLAST(a1>REF(a1,1)); //{波段下跌天数}
    tt1:=PEAK(1,8,1); //{向前数第一个波峰的值,括号中第一个1表示以最高价作为波峰。这里是用这个波峰值作为这个波段的顶}
    bb1:=TROUGH(2,8,1); //{向前数第一个波谷的值,括号中的2表示以最低价作为波谷。这里以这个波谷的值作为这个波段的底}
    H1:=tt1-(tt1-bb1)*0.1; //{设定波段从顶部落下来时,落下的幅度位置,H1是落下10%的位置。以下依此类推}
    H2:=tt1-(tt1-bb1)*0.2;
    H3:=tt1-(tt1-bb1)*0.3;
    H4:=tt1-(tt1-bb1)*0.4;
    H5:=tt1-(tt1-bb1)*0.5;
    H6:=tt1-(tt1-bb1)*0.6;
    H7:=tt1-(tt1-bb1)*0.7;
    L1:=bb1+(tt1-bb1)*0.1; //{设定波段从底部涨上去时,上涨的幅度位置,L1是上涨10%的位置。以下依此类推}
    L2:=bb1+(tt1-bb1)*0.2;
    L3:=bb1+(tt1-bb1)*0.3;
    L4:=bb1+(tt1-bb1)*0.4;
    L5:=bb1+(tt1-bb1)*0.5;
    L6:=bb1+(tt1-bb1)*0.6;
    L7:=bb1+(tt1-bb1)*0.7;
    STICKLINE(a3>0,tt1,tt1,8,0),linethick2,colorred; // {画波段顶}
    STICKLINE(a2>0,bb1,bb1,8,0),linethick2,colorred; //{画波段底}
    STICKLINE(a3>0,H1,H1,8,0),linethick0,colorFFFFCC; // {波段下跌,在H1位置标记"-"。以下类推。}
    STICKLINE(a3>0,H2,H2,8,0),linethick0,colorFFFFCC; //{接上行:因为没有在主图画水平线的函数,所以用一系列的“-”来画出水平线}
    STICKLINE(a3>0,H3,H3,8,0),linethick0,colorFFFFCC;
    STICKLINE(a3>0,H4,H4,8,0),linethick0,colorFFFFCC;
    STICKLINE(a3>0,H5,H5,8,0),linethick0,colorFFFFCC;
    STICKLINE(a3>0,H6,H6,8,0),linethick0,colorFFFFCC;
    STICKLINE(a3>0,H7,H7,8,0),linethick0,colorFFFFCC;
    DRAWTEXT(a3=1,H1,'10%'),linethick0,colorFFFFCC; //{波段下跌,在H1位置标记"10%"。以下类推。}
    DRAWTEXT(a3=1,H2,'20%'),linethick0,colorFFFFCC; //{接上行:在波段下跌第一天处,标注幅度值,看起来一目了然}
    DRAWTEXT(a3=1,H3,'30%'),linethick0,colorFFFFCC;
    DRAWTEXT(a3=1,H4,'40%'),linethick0,colorFFFFCC;
    DRAWTEXT(a3=1,H5,'50%'),linethick0,colorFFFFCC;
    DRAWTEXT(a3=1,H6,'60%'),linethick0,colorFFFFCC;
    DRAWTEXT(a3=1,H7,'70%'),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L1,L1,8,0),linethick0,colorFFFFCC; // {波段上涨,在L1位置标记"-"。以下类推。}
    STICKLINE(a2>0,L2,L2,8,0),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L3,L3,8,0),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L4,L4,8,0),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L5,L5,8,0),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L6,L6,8,0),linethick0,colorFFFFCC;
    STICKLINE(a2>0,L7,L7,8,0),linethick0,colorFFFFCC;
    DRAWTEXT(a2=1,L1*1.015,'10%'),linethick0,colorFFFFCC; //{波段上涨,在L1*1.015位置标记"10%"。以下类推。}
    DRAWTEXT(a2=1,L2*1.015,'20%'),linethick0,colorFFFFCC; //{接上行:在波段上涨第一天处,标注幅度值,看起来一目了然}
    DRAWTEXT(a2=1,L3*1.015,'30%'),linethick0,colorFFFFCC;
    DRAWTEXT(a2=1,L4*1.015,'40%'),linethick0,colorFFFFCC;
    DRAWTEXT(a2=1,L5*1.015,'50%'),linethick0,colorFFFFCC;
    DRAWTEXT(a2=1,L6*1.015,'60%'),linethick0,colorFFFFCC;
    DRAWTEXT(a2=1,L7*1.015,'70%'),linethick0,colorFFFFCC;


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 将{波段幅度}改为同花顺主图 加入收藏