MK:="KDJ.K#MONTH"(9,3,3);
MD:="KDJ.D#MONTH"(9,3,3);
WK:="KDJ.K#WEEK"(9,3,3);
WD:="KDJ.D#WEEK"(9,3,3);
K:="KDJ.K"(9,3,3);D:="KDJ.D"(9,3,3);
KK:="KDJ.K"(16,5,3);DD:="KDJ.D"(16,5,3);
DPRSV:=(INDEXC-LLV(INDEXL,9))/(HHV(INDEXH,9)-LLV(INDEXL,9))*100;
STICKLINE(WK>WD,110,-10,4,0),COLOR000029;
STICKLINE(WK<WD,110,-10,4,0),COLOR292900;
STICKLINE(MK>MD,0,100,4,0),COLOR260026;
STICKLINE(MK<MD,0,100,4,0),COLOR261600;
DRAWBAND(K,RGB(200,20,10),D,RGB(10,100,200));
STICKLINE(KK>DD,KK,DD,3,0),COLOR0039AA;
STICKLINE(KK>DD,KK,DD,2,0),COLOR0069DD;
STICKLINE(KK>DD,KK,DD,1,0),COLOR0099DD;
STICKLINE(KK>DD,KK,DD,0,0),COLOR009AFF;
STICKLINE(KK<DD,KK,DD,3,0),COLOR009900;
STICKLINE(KK<DD,KK,DD,2,0),COLOR00AA00;
STICKLINE(KK<DD,KK,DD,1,0),COLOR00DD00;
STICKLINE(KK<DD,KK,DD,0,0),COLOR00FF00;
DPK:SMA(DPRSV,3,1),COLORYELLOW;
{背离}
DIF:="MACD.DIF"(12,26,9);DEA:="MACD.DEA"(12,26,9);
{K:="KDJ.K"(9,3,3);D:="KDJ.D"(9,3,3);}
RSI1:="RSI.RSI1"(6,12,24);RSI2:="RSI.RSI2"(6,12,24);
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIF,A1+1)<DIF AND CROSS(DIF,DEA);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIF),1));
D1:=REF(C,C1+1)<C AND REF(DIF,C1+1)>DIF AND CROSS(DEA,DIF);
C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1));
D3:=REF(C,C3+1)<C AND REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1);
MACD底背离:=FILTER(B1>0,1);
KDJ底背离:=FILTER(B2>0,1);
RSI底背离:=FILTER(B3>0,1);
MACD顶背离:=FILTER(D1>0,1);
KDJ顶背离:=FILTER(D2>0,1);
RSI顶背离:=FILTER(D3>0,1);
STICKLINE(RSI底背离,0,30,1,0),COLORFFCC66;
DRAWTEXT(RSI底背离,45,'RSI底背'),COLORFFCC66;
STICKLINE(KDJ底背离,0,30,1,0),COLORWHITE;
DRAWTEXT(KDJ底背离,45,'KDJ底背'),COLORWHITE;
STICKLINE(MACD底背离,0,30,1,0),COLORYELLOW;
DRAWTEXT(MACD底背离,45,'MACD底背'),COLORYELLOW;
STICKLINE(RSI顶背离,100,65,1,0),COLORDD9900;
DRAWTEXT(RSI顶背离,80,'RSI顶背'),COLORDD9900;
STICKLINE(KDJ顶背离,100,65,1,0),COLORDDDDDD;
DRAWTEXT(KDJ顶背离,80,'KDJ顶背'),COLORDDDDDD;
STICKLINE(MACD顶背离,100,65,1,0),COLOR0066DD;
DRAWTEXT(MACD顶背离,80,'MACD顶背'),COLOR0066DD;
{买卖奇准}
买:=MA(CLOSE,1);
卖:=(LOW+HIGH+CLOSE)/3;
奇:= MA(卖,5);
准:= HHV(奇,10);
奇准:= MA(卖,5);
买卖:=LLV(奇准,10);
急卖奇准:IF(HHV((买<准),5),100,70),COLORLIBLUE;
短卖奇准:IF(HHV((买<准),10),100,70),COLORGREEN;
急买奇准:IF(LLV((买<买卖),5),30,0),COLORRED;
短买奇准:IF(LLV((买<买卖),10),30,0),COLORYELLOW;
TTR:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),5);
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=(SUM(IF(((HD > 0) AND (HD > LD)),HD,0),5) );
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),5);
神偷线:=(((DMP ) * 100) / TTR);
辅助线:=((DMM * 100) / TTR);
动向趋势线:=(MA(((ABS((辅助线 - 神偷线)) / (辅助线 + 神偷线)) * 100),3));
有戏:( IF(((动向趋势线 > 88) AND (神偷线 < 5.8)),20,0)),LINETHICK1,COLORFF00FF; |