九毛八公式指标
公式模块:
1.请老师根据提供的公式源码,编写出 顶、底背离的选股公式。划线后顶背离、 底背离出现就需要,谢谢。
2.公式中应用未来函数:backset 、drawline,在这个公式应用中是否会出现漂移、消失等不良因素。
N1 5 0 30
VAR2:=LLV(LOW,10);
VAR3:=HHV(HIGH,25);
M:EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4),LINETHICK2,colorFF;
AA1:HHV(MA(M,3),20),LINEDOT;
BB1:LLV(MA(M,3),20),LINEDOT;
AA:=REF(M,N1)=HHV(M,2*N1+1);
BB:=BACKSET(AA,N1+1);
CC:=FILTER(BB,N1) AND M=HHV(M,N1+1);
A1:=BArslAST(REF(CC,1));
顶背离:=REF(HIGH,A1+1)<HIGH AND REF(M,A1+1)>M AND CC;
DRAWLINE(CC,M,FILTER(顶背离>0,5),M,0),colorFF00FF;
DRAWTEXT(顶背离,M,'顶背离'),colorFF00FF;
DRAWICON(顶背离,M,2);
AA2:=REF(M,N1)=LLV(M,2*N1+1);
BB2:=BACKSET(AA2,N1+1);
CC2:=FILTER(BB2,N1) AND M=LLV(M,N1+1);
A2:=BARSLAST(REF(CC2,1));
底背离:=REF(LOW,A2+1)>LOW AND REF(M,A2+1)<M AND CC2;
DRAWLINE(CC,M,FILTER(底背离>0,5),M,0),colorFF00FF;
DRAWTEXT(底背离,M,'底背离'),colorFF00FF;
DRAWICON(底背离,M,1);
VAR5:=M>REF(M,1) AND CLOSE<REF(CLOSE,1);
VAR6:=M<REF(M,1) AND CLOSE>REF(CLOSE,1);
{N1
5 0 30}
VAR2:=LLV(LOW,10);
VAR3:=HHV(HIGH,25);
M:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4);
AA:=REF(M,N1)=HHV(M,2*N1+1);
BB:=BACKSET(AA,N1+1);
CC:=FILTER(BB,N1) AND M=HHV(M,N1+1);
A1:=BARSLAST(REF(CC,1));
顶背离:REF(HIGH,A1+1)<HIGH AND REF(M,A1+1)>M AND CC;