【双线趋势源码】通达信主图:自动划线+双线趋势+上行压力突破+下行支撑点(配合其他副图使用)


根据MACD 顶底计算划线的公式


图例:


下面是源码,写入自己的看盘软件中就可以了,作为副图技术指标来使用。



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

DEA:=EMA(DIFF,9);

N1:=BARSLAST(CROSS(DIFF,DEA))+1;

N2:=BARSLAST(CROSS(DEA,DIFF))+1;

A1:=BACKSET(ISLASTBAR && N1<N2,REF(REF(HHVBARS(H,N1)+1,N2),N2)+REF(N2,N2)+N2);

B1:=BACKSET(ISLASTBAR && N1<N2,REF(HHVBARS(H,N1),N2)+N2+1);

DRAWLINE(CROSS(A1,0.5),H,CROSS(B1,0.5),H,1),COLORRED;

A2:=BACKSET(ISLASTBAR && N1<N2,REF(REF(LLVBARS(L,N2)+1,N1),N2)+REF(N1,N2)+N2);

B2:=BACKSET(ISLASTBAR && N1<N2,REF(LLVBARS(L,N2)+1,N1)+N1);

DRAWLINE(CROSS(A2,0.5),L,CROSS(B2,0.5),L,1),COLORGREEN;

A3:=BACKSET(ISLASTBAR && N1>N2,REF(REF(LLVBARS(L,N2)+1,N1),N1)+REF(N1,N1)+N1);

B3:=BACKSET(ISLASTBAR && N1>N2,REF(LLVBARS(L,N2),N1)+N1+1);

DRAWLINE(CROSS(A3,0.5),L,CROSS(B3,0.5),L,1),COLORGREEN;

A4:=BACKSET(ISLASTBAR && N1>N2,REF(REF(HHVBARS(H,N1)+1,N2),N1)+REF(N2,N1)+N1);

B4:=BACKSET(ISLASTBAR && N1>N2,REF(HHVBARS(H,N1)+1,N2)+N2);

DRAWLINE(CROSS(A4,0.5),H,CROSS(B4,0.5),H,1),COLORRED;

    更多精彩 >>> 热点推荐 查看相关信息 更多精彩 精彩图库

    热门推荐
    热门文章