SQX:=(C-MA(CLOSE,13))*100;
DIF:EMA(MA(SQX,7),1),COLOR00FFFF;
DEA:EMA(DIF,7),COLORFF33FF;
DRAWBAND(DEA,RGB(0,125,0),DIF,RGB(250,70,0));
MACD:(DIF-DEA)*2,COLORSTICK;
DRAWTEXT(CROSS(DIF,DEA),DIF-0,'建仓'),COLORYELLOW;
DRAWTEXT(CROSS(DEA,DIF),DIF+0,'空仓'),COLORGREEN;
STICKLINE(((MACD<REF(MACD,1)) AND (MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;
STICKLINE(((MACD>REF(MACD,1)) AND (MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;
M1:=MACD>REF(MACD,1) AND DIF<DEA;
绿柱短了:=M1 AND COUNT(M1,10)=1 AND C>MA(C,55) AND COUNT(MACD<0,5)>=5,NODRAW;
DRAWTEXT(绿柱短了,MACD,'买点来了');
低金叉:IF(CROSS(DIF,DEA) AND DIF<-0.1,0.3,0),COLORYELLOW,POINTDOT;
STICKLINE(低金叉,0,15,8,0),COLORYELLOW;
DRAWICON(低金叉,0.3,1);
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二金叉:IF(CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1,0.2,0),COLORFF00FF,POINTDOT;
STICKLINE(二金叉,30,15,8,0),COLORFF00FF;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA),0.1,0),COLORRED,POINTDOT;
STICKLINE(底背离,45,30,8,0),COLORRED;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF),COLORGREEN;
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN;
A3:=CROSS(DIF,DEA) AND DEA<0;
零下二金叉:IF(FILTER(COUNT(A3,21)=2,10),0.05,0),COLORWHITE,POINTDOT;
STICKLINE(零下二金叉,45,60,8,0),COLORWHITE;
向上:=IF(DIF>=REF(DIF,1),DIF,DRAWNULL),LINETHICK2,COLORRED;
向下:=IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORGREEN,LINETHICK2;
DRAWICON(CROSS(DIF,DEA) AND DIF>REF(DIF,1) AND DEA<0,DIF,0);
SHORT1:=6;
LONG1:=9;
MID1:=3;
DIF1:=EMA(CLOSE,SHORT1)-EMA(CLOSE,LONG1),LINETHICK1,COLOR0000FF;
DEA1:=EMA(DIF1,MID1);
{DRAWBAND(DIF1,RGB(500,180,280),DEA1,RGB(380,280,180));}
MACD1:=(DIF1-DEA1)*2,COLORSTICK;
向上1:=IF(DIF1>=REF(DIF1,1),DIF1,DRAWNULL),LINETHICK2,COLORRED;
向下1:=IF(DIF1<REF(DIF1,1),DIF1,DRAWNULL),COLORGREEN,LINETHICK2;
{DRAWICON(CROSS(DIF1,DEA1) AND DIF1>REF(DIF1,1) AND DEA1<0,DIF1,0);}
强势区:=IF((EVERY(向下1>=REF(向下1,1),1)),-0.2,0)COLOR0000FF,LINETHICK3;
买入信号:IF(((CROSS(-0.01,强势区))AND DIF1<0),0.2,0),STICK,COLORFF9150,LINETHICK3; |