N:=14;
好:=(HIGH+LOW+CLOSE)/3;
好I:(好-MA(好,N))/(0.015*AVEDEV(好,N));
RSI1:=好I;
金智量化1:=REF(RSI1,N)=HHV(RSI1,2*N+1);
金智量化2:=BACKSET(金智量化1,N+1);
金智量化3:=FILTER(金智量化2,N) AND RSI1=HHV(RSI1,N+1);
金智量化4:=BARSLAST(REF(金智量化3,1));
顶背离:REF(CLOSE,金智量化4+1)< CLOSE AND REF(RSI1,金智量化4+1)>RSI1 AND 金智量化3,;
DRAWICON(顶背离,好I*0.9,2);
DRAWLINE(金智量化3,RSI1,FILTER(顶背离>0,5),RSI1,0),COLORGREEN,LINETHICK1;
金智量化12:=REF(RSI1,N)=LLV(RSI1,2*N+1);
金智量化22:=BACKSET(金智量化12,N+1);
金智量化32:=FILTER(金智量化22,N) AND RSI1=LLV(RSI1,N+1);
金智量化5:=BARSLAST(REF(金智量化32,1));
底背离:REF(CLOSE,金智量化5+1)>CLOSE AND REF(RSI1,金智量化5+1)< RSI1 AND 金智量化32;
DRAWLINE(金智量化32,RSI1,FILTER(底背离>0,5),RSI1,0),COLORMAGENTA,LINETHICK1;
DRAWICON(底背离,-130,7);
好I底背离:=底背离 AND CROSS(好I,-100);
DRAWICON(好I底背离,-150,3);
股:=CROSS(好I,-100);
DRAWICON(股,-100,9);
DRAWTEXT(股,-90,'买入'),COLORYELLOW;
IF(好I>=100,好I,DRAWNULL),COLORGREEN;
IF(好I<=-100,好I,DRAWNULL),COLORRED;