付圖 DIF:EMA(C,12)-EMA(C,26); DEA:EMA(DIF,9); MACD:(DIF-DEA)*2,COLORSTICK; DRAWICON(LLV(MACD,50)=MACD AND FILTERX(LLV(MACD,50)=MACD,20), MACD,1); 金叉后天數(shù):=BARSLAST(MACD<0); 死叉后天數(shù):=BARSLAST(MACD>0); DRAWTEXT(死叉后天數(shù)=3,MACD-0.05,'3'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=5,MACD-0.05,'5'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=8,MACD-0.05,'8'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=13,MACD-0.05,'13'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=21,MACD-0.05,'21'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=34,MACD-0.05,'34'),COLORGREEN; DRAWTEXT(死叉后天數(shù)=55,MACD-0.05,'55'),COLORGREEN; DRAWTEXT(金叉后天數(shù)=3,MACD+0.05,'3'),COLORRED; DRAWTEXT(金叉后天數(shù)=5,MACD+0.05,'5'),COLORRED; DRAWTEXT(金叉后天數(shù)=8,MACD+0.05,'8'),COLORRED; DRAWTEXT(金叉后天數(shù)=13,MACD+0.05,'13'),COLORRED; DRAWTEXT(金叉后天數(shù)=21,MACD+0.05,'21'),COLORRED; DRAWTEXT(金叉后天數(shù)=34,MACD+0.05,'34'),COLORRED; DRAWTEXT(金叉后天數(shù)=55,MACD+0.05,'55'),COLORRED; DRAWTEXT_FIX(C>O,0.01,0.9,0,'微信公眾號:整點財經(jīng)'),COLORRED; 底部金叉:=CROSS(DIF,DEA) AND DIF<-0.1; STICKLINE(底部金叉,0,-0.18,0,0),COLORGREEN; DRAWTEXT(底部金叉,-0.15,' 底部金叉'),COLORRED; 金叉次數(shù):=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0)); 雙重金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(金叉次數(shù)=2,21)=1; STICKLINE(雙重金叉,0,-0.18,0,0),COLORFF00FF; DRAWTEXT(雙重金叉,-0.3,' 雙重金叉'),COLORFF00FF; 金叉位置:=BARSLAST(REF(CROSS(DIF,DEA),1)); 底背離:=REF(C,金叉位置+1)>C AND DIF>REF(DIF,金叉位置+1) AND CROSS(DIF,DEA); STICKLINE(底背離,0,0.13,1,0),COLOR00FF00; DRAWTEXT(底背離,0.18,' 底背離'),COLOR00FF00; 死叉位置:=BARSLAST(REF(CROSS(DEA,DIF),1)); 頂背離:=REF(C,死叉位置+1)<C AND REF(DIF,死叉位置+1)>DIF AND CROSS(DEA,DIF); DRAWTEXT(底部金叉 AND 雙重金叉 AND 底背離,0.51,'三重'),COLORGREEN,LINETHICK1; DRAWTEXT(底部金叉 AND 底背離,0.31,'二重'),COLORLIBLUE,LINETHICK1; 多:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK1; 空:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLORLIBLUE,LINETHICK1; RSI1:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100; RSI2:=SMA(MAX(C-REF(C,1),0),10,1)/SMA(ABS(C-REF(C,1)),10,1)*100; RSI金叉位置:=BARSLAST(REF(CROSS(RSI1,RSI2),1)); RSI底背離:=REF(C,RSI金叉位置+1)>C AND REF(RSI1,RSI金叉位置+1)<RSI1 AND CROSS(RSI1,RSI2); DRAWTEXT(RSI底背離>0,-0.2,'RSI底背離'),COLORCYAN;{RSI底背離}; RSI死叉位置:=BARSLAST(REF(CROSS(RSI2,RSI1),1)); RSI頂背離:=REF(C,RSI死叉位置+1)<C AND REF(RSI1,RSI死叉位置+1)>RSI1 AND CROSS(RSI2,RSI1); DRAWTEXT(RSI頂背離>0,0.3,'RSI頂背離'),COLORRED;{RSI頂背離}; DRAWICON(死叉后天數(shù)=13,DIF,25); 選股 DIF:=EMA(C,12)-EMA(C,26); DEA:=EMA(DIF,9); MACD:=(DIF-DEA)*2; 金叉后天數(shù):=BARSLAST(MACD<0); 死叉后天數(shù):=BARSLAST(MACD>0); 底部金叉:=CROSS(DIF,DEA) AND DIF<-0.1; 金叉次數(shù):=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0)); 雙重金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(金叉次數(shù)=2,21)=1; 金叉位置:=BARSLAST(REF(CROSS(DIF,DEA),1)); 底背離:=REF(C,金叉位置+1)>C AND DIF>REF(DIF,金叉位置+1) AND CROSS(DIF,DEA); 死叉位置:=BARSLAST(REF(CROSS(DEA,DIF),1)); 頂背離:=REF(C,死叉位置+1)<C AND REF(DIF,死叉位置+1)>DIF AND CROSS(DEA,DIF); 多:=IF(DIF>REF(DIF,1),DIF,DRAWNULL); 空:=IF(DIF<REF(DIF,1),DIF,DRAWNULL); RSI1:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100; RSI2:=SMA(MAX(C-REF(C,1),0),10,1)/SMA(ABS(C-REF(C,1)),10,1)*100; RSI金叉位置:=BARSLAST(REF(CROSS(RSI1,RSI2),1)); RSI底背離:=REF(C,RSI金叉位置+1)>C AND REF(RSI1,RSI金叉位置+1)<RSI1 AND CROSS(RSI1,RSI2); RSI死叉位置:=BARSLAST(REF(CROSS(RSI2,RSI1),1)); RSI頂背離:=REF(C,RSI死叉位置+1)<C AND REF(RSI1,RSI死叉位置+1)>RSI1 AND CROSS(RSI2,RSI1); 死叉后天數(shù)=13; |
|
來自: 獵人一個 > 《優(yōu)化自用版》