常用指标背离组合图(主图)和选股指标(附件 源码 无加密)
{常用指标背离组合图 (指标公式 主图用)}
k2:EMA(CLOSE,6),colorffff00;
k3:EMA(CLOSE,9),colorffff00;
k5:EMA(CLOSE,12),colorffff00;
k7:EMA(CLOSE,15),colorffff00;
k10:EMA(CLOSE,18),colorffff00;
k13:EMA(CLOSE,21),colorffff00;
k16:EMA(CLOSE,24),colorffff00;
IF (k2>REF(k2,1),k2,k2),colorred;
IF (k3>REF(k3,1),k3,k2),colorred;
IF (k5>REF(k5,1),k5,k2),colorred;
IF (k7>REF(k7,1),k7,k2),colorred;
IF (k10>REF(k10,1),k10,k2),colorred;
IF (k13>REF(k13,1),k13,k2),colorred;
IF (k16>REF(k16,1),k16,k2),colorred;
hhv(h,20),colorccffff,linethick2;
llv(l,20),coloryellow,linethick2;
STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLOR7070ff;
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),colorffcc66;
STICKLINE(C<=O,H,L,0,0),colorffcc66;
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= PDM*100/TR;
MDI:= MDM*100/TR;
A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
B1:=ref(c,A1+1)>c and ref("macd.diff"(12,26,9),A1+1)
<"macd.diff"(12,26,9) and cross
("macd.diff"(12,26,9),"macd.dea"(12,26,9));
A2:=BARSLAST(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
B2:=ref(c,A2+1)>c and ref("kdj.k"(9,3,3),A2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1"(6,12,24),A3+1)
<"RSI.RSI1"(6,12,24) and cross
("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
D1:=ref(c,C1+1)<c and ref("macd.diff"(12,26,9),C1+1)
>"macd.diff"(12,26,9) and cross
("macd.dea"(12,26,9),"macd.diff"(12,26,9));
C2:=BARSLAST(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
D2:=ref(c,C2+1)<c and ref("kdj.k"(9,3,3),C2+1)>"kdj.k"(9,3,3) and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1"(6,12,24),C3+1)
>"RSI.RSI1"(6,12,24) and cross
("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
C4:=BARSLAST(ref(cross(mdi,pdi),1));
D4:=ref(c,C4+1)<c and ref(mdi,C4+1)>mdi and cross(mdi,pdi);
A4:=BARSLAST(ref(cross(PDI,MDI),1));
B4:=ref(c,A4+1)>c and ref(pdi,A4+1)<pdi and cross(pdi,mdi);
STICKLINE(B4,l,l-0.06,4,0),COLORFFCCFF;
DRAWTEXT(B4,L-0.09,'DMI底背'),COLORFFCCFF;
STICKLINE(D4,H,H+0.06,4,0),COLORWHITE;
DRAWTEXT(D4,H+0.09,'DMI顶背'),COLORWHITE;
STICKLINE(B1,l,l-0.06,4,0),COLORFF00FF;
DRAWTEXT(B1,l-0.09,'MACD底背'),COLORFF00FF;
STICKLINE(B2,l,l-0.06,4,0),COLORYELLOW;
DRAWTEXT(B2,L-0.09,'KDJ底背'),COLORYELLOW;
STICKLINE(B3,L,L-0.04,4,0),COLORRED;
DRAWTEXT(B3,L-0.09,'RSI底背'),COLORRED;
STICKLINE(D1,H,H+0.06,4,0),COLORFFCC66;
DRAWTEXT(D1,H+0.09,'MACD顶背'),COLORFFCC66;
STICKLINE(D2,H,H+0.06,4,0),COLORC0A8FF;
DRAWTEXT(D2,H+0.09,'KDJ顶背'),COLORC0A8FF;
STICKLINE(D3,H,H+0.06,4,0),COLORFFCCCC;
DRAWTEXT(D3,H+0.09,'RSI顶背'),COLORFFCCCC;
ma13:=ma(c,13);
vll:=cross(ma(c,13),ma(c,21));
DRAWTEXT(vll,ma13,'●'),colorwhite;
DRAWTEXT(vll,ma13-0.09,'圆弧底'),colorwhite;
》》 下载此文件
{常用指标背离选股公式}
TR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= PDM*100/TR;
MDI:= MDM*100/TR;
A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9)),1));
B1:=ref(c,A1+1)>c and ref("macd.diff"(12,26,9),A1+1)
<"macd.diff"(12,26,9) and cross
("macd.diff"(12,26,9),"macd.dea"(12,26,9));
A2:=BARSLAST(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1));
B2:=ref(c,A2+1)>c and ref("kdj.k"(9,3,3),A2+1)<"kdj.k"(9,3,3) and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));
A3:=BARSLAST(ref(cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=ref(c,A3+1)>c and ref("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) and cross("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9)),1));
D1:=ref(c,C1+1)<c and ref("macd.diff"(12,26,9),C1+1)>"macd.diff"(12,26,9) and cross("macd.dea"(12,26,9),"macd.diff"(12,26,9));
C2:=BARSLAST(ref(cross("kdj.d"(9,3,3),"kdj.k"(9,3,3)),1));
D2:=ref(c,C2+1)<c and ref("kdj.k"(9,3,3),C2+1)>"kdj.k"(9,3,3) and cross("kdj.d"(9,3,3),"kdj.k"(9,3,3));
C3:=BARSLAST(ref(cross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) and cross
("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
C4:=BARSLAST(ref(cross(mdi,pdi),1));
D4:=ref(c,C4+1)<c and ref(mdi,C4+1)>mdi and cross(mdi,pdi);
A4:=BARSLAST(ref(cross(PDI,MDI),1));
B4:=ref(c,A4+1)>c and ref(pdi,A4+1)<pdi and cross(pdi,mdi);
DMI底背:=B4;MACD底背:=B1;KDJ底背:=B2;RSI底背:=B3;
ma13:=ma(c,13);
vll:=cross(ma(c,13),ma(c,21));
圆弧底:=vll;B1 OR B2 OR B3{ OR B4 OR vll};
|