最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 通达信突破趋势线指标 主图九毛八公式指标网

    正文概述    2024-04-07 10:35:24  

    主图指标源码奉上~看看有没有高人能够做出选股公式出来~~

    要求就是当日股价突破上方红色趋势线发出信号~~~

    源码:

    {连结MACD相邻红绿柱区间内高低点画趋势线 通达信}

    DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
    DEA:=EMA(DIFF,9);

    N1:=BARSLAST(CROSS(DIFF,DEA))+1;{最近一次满足条件DIFF上穿DEA的K线到当前的距离}
    N2:=BARSLAST(CROSS(DEA,DIFF))+1;{最近一次满足条件DIFF下穿DEA的K线到当前的距离}


    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间(不包含当前区间)内最高点的趋势线}
    A1:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N2)+REF(N2,N2)+N2);
    B1:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1),N2)+N2+1);
    DRAWLINE(CROSS(A1,0.5),H,CROSS(B1,0.5),H,1),COLORRED;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间内最低点的趋势线}
    A2:=BACKSET(ISLASTBAR & N2,REF(REF(LLVBARS(L,N2)+1,N1),N2)+REF(N1,N2)+N2);
    B2:=BACKSET(ISLASTBAR & N2,REF(LLVBARS(L,N2)+1,N1)+N1);
    DRAWLINE(CROSS(A2,0.5),L,CROSS(B2,0.5),L,1),COLORGREEN;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间(不包含当前区间)内最低点的趋势线}
    A3:=BACKSET(ISLASTBAR & N2,REF(REF(LLVBARS(L,N2)+1,N1),N1)+REF(N1,N1)+N1);
    B3:=BACKSET(ISLASTBAR & N2,REF(LLVBARS(L,N2),N1)+N1+1);
    DRAWLINE(CROSS(A3,0.5),L,CROSS(B3,0.5),L,1),COLORGREEN;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间内最高点的趋势线}
    A4:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N1)+REF(N2,N1)+N1);
    B4:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1)+1,N2)+N2);
    DRAWLINE(CROSS(A4,0.5),H,CROSS(B4,0.5),H,1),COLORRED;

    要求就是当日股价突破上方红色趋势线发出信号~~~

    源码:

    {连结MACD相邻红绿柱区间内高低点画趋势线 通达信}

    DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
    DEA:=EMA(DIFF,9);

    N1:=BARSLAST(CROSS(DIFF,DEA))+1;{最近一次满足条件DIFF上穿DEA的K线到当前的距离}
    N2:=BARSLAST(CROSS(DEA,DIFF))+1;{最近一次满足条件DIFF下穿DEA的K线到当前的距离}


    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间(不包含当前区间)内最高点的趋势线}
    A1:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N2)+REF(N2,N2)+N2);
    B1:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1),N2)+N2+1);
    DRAWLINE(CROSS(A1,0.5),H,CROSS(B1,0.5),H,1),COLORRED;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间内最低点的趋势线}
    A2:=BACKSET(ISLASTBAR & N2,REF(REF(LLVBARS(L,N2)+1,N1),N2)+REF(N1,N2)+N2);
    B2:=BACKSET(ISLASTBAR & N2,REF(LLVBARS(L,N2)+1,N1)+N1);
    DRAWLINE(CROSS(A2,0.5),L,CROSS(B2,0.5),L,1),COLORGREEN;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间(不包含当前区间)内最低点的趋势线}
    A3:=BACKSET(ISLASTBAR & N2,REF(REF(LLVBARS(L,N2)+1,N1),N1)+REF(N1,N1)+N1);
    B3:=BACKSET(ISLASTBAR & N2,REF(LLVBARS(L,N2),N1)+N1+1);
    DRAWLINE(CROSS(A3,0.5),L,CROSS(B3,0.5),L,1),COLORGREEN;

    {当前是DIFF DEA的状态,连结最近两个DIFF DEA区间内最高点的趋势线}
    A4:=BACKSET(ISLASTBAR & N2,REF(REF(HHVBARS(H,N1)+1,N2),N1)+REF(N2,N1)+N1);
    B4:=BACKSET(ISLASTBAR & N2,REF(HHVBARS(H,N1)+1,N2)+N2);
    DRAWLINE(CROSS(A4,0.5),H,CROSS(B4,0.5),H,1),COLORRED;

    通达信突破趋势线指标 主图源码 贴图


    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 通达信突破趋势线指标 主图九毛八公式指标网 加入收藏