指标只是给你一个参考范围,这套指标因为画线会有未来函数,不喜绕道。
因为使用趋势画线,所以 不能进行历史选股。可以实盘预警和盘后选股
{主图画线}
F:=MACD.DIF;
D:=MACD.DEA;
M:=MACD.MACD;
HT:=BARSLAST(CROSS(F,D));
HT1:=SUMBARS(HT=0,2);
LT:=BARSLAST(CROSS(D,F));
LT1:=SUMBARS(LT=0,2);
H1:=BARSLAST(H=HHV(H,HT+1));
H2:=REF(H1,LT)+CONST(LT);
H3:=REF(H1,LT1-1)+CONST(LT1);
L1:=BARSLAST(L=LLV(L,LT+1));
L2:=REF(L1,HT1-1)+CONST(HT1);
L3:=REF(L1,HT)+CONST(HT);
HH1:=FINDHIGHBARS(H,1,CONST(L1),1);
LL1:=FINDLOWBARS(L,1,CONST(HT),1);
GJ:=REF(H,BARSLAST(CURRBARSCOUNT=CONST(HH1)+1));
GJ1:=REF(H,BARSLAST(CURRBARSCOUNT=CONST(H1)+1));
EXT1:DRAWLINE(CURRBARSCOUNT=CONST(H2)+1,H,CONST(M)>0 AND CURRBARSCOUNT=CONST(HH1)+1,H,1),COLORRED;
EXT2:DRAWLINE(CURRBARSCOUNT=CONST(H3),H,CONST(M)<0 AND CURRBARSCOUNT=CONST(H1)+1,H,1),COLORRED;
TJ1:=CROSS(C,EXT1) AND CONST(M)>0;
TJ2:=CROSS(C,EXT2) AND CONST(M)<0;
T:=BARSLAST(TJ1 OR TJ2);
DRAWLINE(CURRBARSCOUNT=CONST(T)+1,L,ISLASTBAR,REF(L,T),0),COLORCYAN,DOTLINE;
GT:=BARSLAST(H=HHV(H,T+1) AND NOT(ISLASTBAR));
DRAWLINE(CURRBARSCOUNT=CONST(GT)+1,H,ISLASTBAR,REF(H,GT),0),COLORMAGENTA,DOTLINE;
{选股}
F:=MACD.DIF;
D:=MACD.DEA;
M:=MACD.MACD;
HT:=BARSLAST(CROSS(F,D));
HT1:=SUMBARS(HT=0,2);
LT:=BARSLAST(CROSS(D,F));
LT1:=SUMBARS(LT=0,2);
H1:=BARSLAST(H=HHV(H,HT+1));
H2:=REF(H1,LT)+CONST(LT);
H3:=REF(H1,LT1-1)+CONST(LT1);
L1:=BARSLAST(L=LLV(L,LT+1));
HH1:=FINDHIGHBARS(H,1,CONST(L1),1);
TJ1:=CONST(M)>0 AND REF(H,CONST(H2))>REF(H,CONST(HH1));
TJ2:=CONST(M)<0 AND REF(H,CONST(H3))>REF(H,CONST(H1));
XG1:=TJ1 OR TJ2;
EXT1:=DRAWLINE(CURRBARSCOUNT=CONST(H2)+1,H,CONST(M)>0 AND CURRBARSCOUNT=CONST(HH1)+1,H,1);
EXT2:=DRAWLINE(CURRBARSCOUNT=CONST(H3),H,CONST(M)<0 AND CURRBARSCOUNT=CONST(H1)+1,H,1);
TJ3:=CROSS(C,EXT1) AND CONST(M)>0;
TJ4:=CROSS(C,EXT2) AND CONST(M)<0;
T:=BARSLAST(TJ3 OR TJ4);
GT:=BARSLAST(H=HHV(H,T+1) AND NOT(ISLASTBAR));
DD:=LLV(L,T);
XG:CROSS(C,REF(H,GT)) AND V>REF(V,1) AND XG1 AND DD>REF(L,T) AND DYNAINFO(17)!=0;
|