彩红线
MA1:MA(CLOSE,6),colorred;
MA2:MA(CLOSE,12),colorred;
MA3:MA(CLOSE,18),colorred;
MA4:MA(CLOSE,24),colorgreen;
MA5:MA(CLOSE,30),coloryellow;
MA6:MA(CLOSE,36),coloryellow;
MA7:MA(CLOSE,42),coloryellow;
MA8:MA(CLOSE,48),coloryellow;
MA9:MA(CLOSE,100),colorblue;
MA10:MA(CLOSE,112),colorblue;
MA11:MA(CLOSE,124),colorblue;
MA12:MA(CLOSE,138),colorblue;
MA13:MA(CLOSE,204),colorwhite;
MA14:MA(CLOSE,216),colorwhite;
MA15:MA(CLOSE,228),colorwhite;
MA16:MA(CLOSE,260),colorwhite;
A1:=BARSLAST(ref(cross("macd.diff"(26,12,9),"macd.dea"(26,12,9)),1));
B1:=ref(c,A1+1)>c and ref("macd.diff"(26,12,9),A1+1)<"macd.diff"(26,12,9) and cross("macd.diff"(26,12,9),"macd.dea"(26,12,9));
DRAWTEXT(FILTER(B1>0,5),l-l*0.01,'MACD底背'),COLORGREEN;
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));
DRAWTEXT(FILTER(B2>0,5),l-l*0.02,'KDJ底背'),COLORYELLOW;
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));
DRAWTEXT(FILTER(B3>0,5),l-l*0.03,'RSI底背'),COLORCYAN;
C1:=BARSLAST(ref(cross("macd.dea","macd.diff"),1));
D1:=ref(c,C1+1)<c and ref("macd.diff",C1+1)>"macd.diff" and cross("macd.dea","macd.diff");
DRAWTEXT(FILTER(D1>0,5),h+h*0.01,'MACD顶背'),COLORwhite;
C2:=BARSLAST(ref(cross("kdj.d","kdj.k"),1));
D2:=ref(c,C2+1)<c and ref("kdj.k",C2+1)>"kdj.k" and cross("kdj.d","kdj.k");
DRAWTEXT(FILTER(D2>0,5),h+h*0.02,'KDJ顶背'),COLORwhite;
C3:=BARSLAST(ref(cross("RSI.RSI2","RSI.RSI1"),1));
D3:=ref(c,C3+1)<c and ref("RSI.RSI1",C3+1)>"RSI.RSI1" and cross("RSI.RSI2","RSI.RSI1");
DRAWTEXT(FILTER(D3>0,5),h+h*0.03,'RSI顶背'),COLORMAGENTA; |