股票论坛

标题: 请教,画线能不偏移吗? [打印本页]

作者: 心诚    时间: 2015-8-12 19:58
标题: 请教,画线能不偏移吗?
以下画线总有点偏移
请求老师给个画线不偏移的完美代码?

DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;
DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:RAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:RAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;

作者: 方天问    时间: 2015-8-12 19:58
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;
DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:RAWLINE(REFX(A1=0,1),DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:RAWLINE(REFX(A2=0,1),DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;




欢迎光临 股票论坛 (http://100000w.com/) Powered by Discuz! X3.2