這個(gè)副圖中還有其他的信號(hào),比如底部金叉,紅色箭頭買(mǎi)進(jìn),這些信號(hào)都在副圖中清楚的標(biāo)注有,大家放到自己的系統(tǒng)中,好好體會(huì)一下他的用法。 選股公式源碼如下: DIF:100*(EMA(CLOSE,12)-EMA(CLOSE,26)),COLORWHITE,LINETHICK1; DEA:EMA(DIF,9),COLORYELLOW,LINETHICK1; MACD:(DIF-DEA)*2,COLORSTICK; STICKLINE((MACD>=0),0,MACD,1,0),COLOR0000FF; STICKLINE(((MACD>=0) AND (MACD < REF(MACD,1))),0,MACD,1,-1),COLOR0090FF; STICKLINE((MACD<0),0,MACD,1,1),COLORGREEN; STICKLINE(((MACD<0) AND (MACD > REF(MACD,1))),0,MACD,1,0),COLORCYAN; STICKLINE(CROSS(DIF,0),0,MACD,1,0),COLORMAGENTA; STICKLINE(CROSS(0,DIF),0,MACD,1,0),COLORWHITE; FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4); FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1; FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1); FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018; FH5:=FH1 AND FH2 AND MACD<0.10; 二次翻紅:(FH3 OR FH4 OR FH5),COLORRED,NODRAW; 低買(mǎi):CROSS(DIF,DEA) AND DIF<0,COLORFF00FF,NODRAW; 加油:CROSS(DIF,DEA) AND DIF>0,COLORYELLOW,NODRAW; DRAWICON(二次翻紅,-0.05,1); DRAWTEXT(二次翻紅,-0.15,'↖翻紅'),COLORRED; DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'↖低買(mǎi)'),COLORFF00FF; DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'↖加油'),COLORYELLOW; XG:二次翻紅 OR 低買(mǎi) OR 加油,NODRAW; YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01)/100); A1:=C>REF(C,4); NT:=BARSLASTCOUNT(A1); TJ11:=NT=9; TJ13:=ISLASTBAR AND BETWEEN(NT,5,8); AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT; DRAWTEXT(AY>0,MACD*1.02,VAR2STR(AY,0)),COLORLIRED; DRAWTEXT(NT=9,MACD*1.02,'9'),COLORGREEN; B1:=C<REF(C,4); NT0:=BARSLASTCOUNT(B1); TJ21:=NT0=9 ; TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8); AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0; DRAWTEXT(AY1>0,MACD*0.98,VAR2STR(AY1,0)),COLORGREEN; DRAWTEXT(NT0=9,MACD*0.98,'9'),COLORRED; DRAWICON(CROSS(DIF,DEA),DEA,1); DRAWICON(CROSS(DEA,DIF),DEA,2); 死叉:=CROSS(DEA,DIF); N1:=BARSLAST(死叉),NODRAW;{最近一次死叉的位置} N2:=REF(BARSLAST(死叉),N1+1),NODRAW;{倒數(shù)第二次死叉與倒數(shù)第一次死叉的區(qū)間} N3:=REF(BARSLAST(死叉),N2+N1+2),NODRAW;{倒數(shù)第三次死叉與倒數(shù)第二次死叉的區(qū)間} CL1:=LLV(C,N1+1),NODRAW;{最近一次死叉后,最低收盤(pán)價(jià)} DIFL1:=LLV(DIF,N1+1),NODRAW;{買(mǎi)好股公式網(wǎng)} CL2:=REF(CL1,N1+1),NODRAW;{倒數(shù)第二次死叉與倒數(shù)第一次死叉之間的最低收盤(pán)價(jià)} DIFL2:=REF(DIFL1,N1+1),NODRAW; CL3:=REF(CL2,N1+1),NODRAW;{倒數(shù)第三次死叉與倒數(shù)第二次死叉之間的最低收盤(pán)價(jià)} DIFL3:=REF(DIFL2,N1+1),NODRAW; PDIFL2:=IF(DIFL2>0,INTPART(LOG(DIFL2))-1,INTPART(LOG(-DIFL2))-1); MDIFL2:=INTPART(DIFL2/POW(10,PDIFL2)); PDIFL3:=IF(DIFL3>0,INTPART(LOG(DIFL3))-1,INTPART(LOG(-DIFL3))-1); MDIFL3:=INTPART(DIFL3/POW(10,PDIFL3)); MDIFB2:=INTPART(DIF/POW(10,PDIFL2)); MDIFB3:=INTPART(DIF/POW(10,PDIFL3)); 直接底背離:=(CL1<CL2 ) AND (MDIFB2>MDIFL2) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB2<=REF(MDIFB2,1); 隔峰底背離:=(CL1<CL3 AND CL3<CL2 ) AND (MDIFB3>MDIFL3) AND (MACD<0 AND REF(MACD,1)<0) AND MDIFB3<=REF(MDIFB3,1); 底部鈍化:直接底背離 OR 隔峰底背離,NODRAW; 底背離:((MDIFB2>REF(MDIFB2,1))*REF(直接底背離,1)) OR ((MDIFB3>REF(MDIFB3,1))*REF(隔峰底背離,1)),NODRAW; 底背離消失:=(REF(直接底背離,1) AND DIFL1<=DIFL2 ) OR (REF(隔峰底背離,1) AND DIFL1<=DIFL3); STICKLINE(底部鈍化,DIF,DEA,1,0),COLORMAGENTA; DRAWTEXT(TFILTER(底背離,C<REF(CL1,1),1),DIF*1.12,'結(jié)構(gòu)形成'),COLORMAGENTA; 溫馨提示 :所有的公式,包括選股公式和主副圖公式的源碼,發(fā)出去以后,可能會(huì)出現(xiàn)一些識(shí)別誤差,但是只要有一點(diǎn)誤差,測(cè)試都不會(huì)通過(guò),如果股友們?cè)趶?fù)制粘貼源碼的過(guò)程中有什么問(wèn)題,可以在文章底部留言 |
|