{GJMACD}
input:p(26),s(12),m(9);
DIFF:EMA(CLOSE,S)-EMA(CLOSE,P);
DEA:EMA(DIFF,M);
MACD:2*(DIFF-DEA),COLORSTICK;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;
DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;
FILLRGN(DIFF>DEA,DIFF,DEA),COLOR505099;
FILLRGN(DIFF
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*0.9,1) ;
DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;
DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;
{柱长:=HHV("MACD.MACD",SYSPARAM(3)-SYSPARAM(2))*2/2;}
{STICKLINE(CROSS("MACD.MACD",0),0,柱长[DATACOUNT],2,0),COLOR0000FF;}
{STICKLINE(CROSS(0,"MACD.MACD"),0,-柱长[DATACOUNT],2,0),COLOR00FF00;}
STICKLINE(MACD>=0,MACD,0,5,0),COLORF00FF0;
STICKLINE(MACD<0,MACD,0,5,0),COLORF00FF0;
STICKLINE(MACD[0,0,MACD,5,1 ),COLORFFFF00;]
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,5,1 ),COLORFFFF00;
IF(DIFF<0,DIFF,0),COLORRED;
IF(DIFF<0,0,DIFF),COLORRED;
IF(DIFF
IF(DIFF>DEA,DEA,DEA),COLORWHITE,LINETHICK1;
交叉位:=(((((13 * 27) * DEA) - ((27 * 11) * EMA(CLOSE,12))) + ((25 * 13) * EMA(CLOSE,26))) / ((2 * 27) - (2 * 13)));
n1:=sysparam(3); n2:=sysparam(2); n3:=(n1-n2)+1; hh:=hhv(DIFF,n3); ll:=llv(DIFF,n3);
zhh:=hh[n1]; zll:=ll[n1];
DRAWTEXT(BARPOS=SYSPARAM(3) and 交叉位
DRAWTEXT(BARPOS=SYSPARAM(3) and 交叉位>C,zll,'预测金叉价: '+NUMTOSTR(交叉位,2)),ALIGN2,SHIFT3,PXUP10,ColorFF8EFF;
多转空:((((LLV(MACD,4)>0) AND (MACD[REF(MACD,2))) AND (REF(MACD,2)>REF(MACD,3))),LINETHICK0;]
空转多:((((HHV(MACD,4)<0) AND (MACD>REF(MACD,1))) AND (REF(MACD,1)
DRAWICON(多转空,MACD*1.2,5);
DRAWICON(空转多,MACD*1.2,4);
机会来临:REF(IF((MA(C,5)-C)/C>0.04 AND (MA(C,10)-MA(C,5))/MA(C,5)>0.04,0.5,0),1);
JJ:=(H+L+C)/3;QJ0:=VOL/IF(H=L,4,H-L);J:="KDJ.J";
QJ1:=IF(CAPITAL=0,QJ0*(JJ-MIN(C,O)),QJ0*(MIN(O,C)-L));
QJ2:=IF(CAPITAL=0,QJ0*(MIN(O,C)-L),QJ0*(JJ-MIN(C,O)));
QJ3:=QJ0*(H-MAX(O,C));QJ4:=QJ0*(MAX(C,O)-JJ);
QJ5:=QJ1+QJ2;QJ6:=QJ3+QJ4;DD:=(QJ5-QJ6)/(QJ5+QJ6)*100;
DDX:=((QJ1+QJ2)-(QJ3+QJ4))/SUM(VOL,10)*100;DDZ:=DD*17;
DDY:=((QJ2+QJ4)-(QJ1+QJ3))/SUM(VOL,10)*100;
弄点钱玩:CROSS(J,0) AND ((DDX>0 AND DDY>0) OR DDZ>400),COLORBLUE,LINETHICK0;
DRAWICON(弄点钱玩,0,3),COLORBLUE;
|