DIF:=EMA(CLOSE,12)-EMA(CLOSE,26); DEA:=EMA(DIF,9); MACD:=(DIF-DEA)*2; VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1); VA2:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5); 前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORWHITE; VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1); VA4:=CROSS(BACKSET(CROSS(MACD,0) OR (ISLASTBAR AND MACD<0),REF(VA3,1)+2),0.5); 前低:=DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),COLORYELLOW; X:IF(COUNT(MACD>0,BARSLAST(VA2))=BARSLAST(VA2),DRAWLINE(VA2,H,REF(VA2,1),REF(H,1),1), DRAWNULL),COLORGREEN,LINETHICK2; STICKLINE(MACD>0 AND C>X AND O>X,C,O,1,0),COLORRED; STICKLINE(MACD>0 AND C>X AND O<X,C,X,1,0),COLORRED; STICKLINE(MACD>0 AND MACD>前高,C,O,1,0),COLORYELLOW; STICKLINE(REFX(VA2,1) OR REFX(VA4,1),C,O,1,0),COLORGREEN; JC:=CROSS(DIF,DEA); JTS:=BARSLAST(DIF<DEA); SC:=CROSS(DEA,DIF); STS:=BARSLAST(DIF>DEA); 價格低點:IF(JTS>0,DRAWLINE(JC,L,REF(JC,1),REF(L,1),1),DRAWNULL),COLORMAGENTA,LINETHICK2; 價格高點:IF(STS>0,DRAWLINE(SC,H,REF(SC,1),REF(H,1),1),DRAWNULL),COLORYELLOW,LINETHICK2; JGDD:=DRAWLINE(JC,L,REF(JC,1),REF(L,1),1); JGGD:=DRAWLINE(SC,H,REF(SC,1),REF(H,1),1); WW:=BARSLAST(VA4)<=REF(IF(VA4,BARSNEXT(JC),DRAWNULL),BARSLAST(VA4)); 指標低點:IF(WW,DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1),DRAWNULL),COLORWHITE,LINETHICK2; 白線:=DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1); STICKLINE(MAX(C,O)<指標低點,C,O,1,0),COLORWHITE; STICKLINE(MAX(C,O)>指標低點 AND MIN(C,O)<指標低點,指標低點,MIN(C,O),1,0),COLORWHITE; STICKLINE(價格低點<白線 AND MAX(C,O)>價格低點 AND MIN(C,O)<價格低點,價格低點, MIN(C,O),1,0),COLORMAGENTA; STICKLINE(價格低點<白線 AND MAX(C,O)<價格低點,C,O,1,0),COLORMAGENTA; A:DRAWTEXT(價格低點<白線 AND O<價格低點 AND C>價格低點 AND MACD>REF(MACD,1) AND REF(C,1)<價格低點 AND JTS>1,L*0.99,'A'),COLORYELLOW; B:DRAWTEXT(JC AND 價格低點>JGGD,L*0.99,'B'); J:DRAWTEXT(NOT(WW) AND C>價格高點 AND O<價格高點,L*0.99,'C'); D:DRAWTEXT(WW AND C>價格高點 AND O<價格高點,L*0.99,'D'),COLORYELLOW; E:DRAWTEXT(SC AND 價格高點<JGDD,價格高點*1.007,'E'); F:DRAWTEXT(VA4 AND 指標低點>JGGD,H*1.007,'F'); G:DRAWTEXT(MACD>0 AND MACD>前高 AND MACD>REF(MACD,1) AND C<REF(C,1),H*1.007,'G'); Z:DRAWTEXT(MACD>0 AND MACD>前高,L*0.99,'Z'); S:DRAWTEXT(MACD>0 AND MACD>REF(MACD,1) AND REF(MACD,5)>0 AND C<REF(C,1) AND C<價格低點,L*0.99,'S'); DRAWTEXT_FIX(C>0,0,0.9,0,'A :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.025,0.9,0,'挖坑結(jié)束、還需確認'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.2,0.9,0,'B :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.225,0.9,0,'小心筑頂、紅柱保護'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.4,0.9,0,'J :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.425,0.9,0,'簡單騙術(shù)、時間和諧'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.6,0.9,0,'D :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.625,0.9,0,'再漲一段、注意真假'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.8,0.9,0,'E :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.825,0.9,0,'離場觀望'),COLORYELLOW; DRAWTEXT_FIX(C>0,0,1,0,'F :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.025,1,0,'多頭猛進'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.2,1,0,'G :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.225,1,0,'傻子才賣'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.4,1,0,'Z :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.425,1,0,'等著數(shù)錢'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.6,1,0,'S :'),COLORYELLOW; DRAWTEXT_FIX(C>0,0.625,1,0,'賣是傻子'),COLORYELLOW; |
|