文华财经WH7顶底背离共振买卖点预警公式源码:
MA1:MA(V,5);
MA2:MA(V,60);
MA5:MA(C,5);
MA10:MA(C,10);
MA60:MA(C,60);
//MACD
DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))*100,COLORGREEN,LINETHICK3;
DEA:EMA(DIF,9),COLORMAGENTA,LINETHICK3;
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD>0,0,MACD,2,0),COLORRED;
STICKLINE(MACD<0,0,MACD,2,0),COLORGREEN;
STICKLINE(MACD>REF(MACD,1) AND MACD<0 ,0,MACD,2,0),COLORMAGENTA;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,2,0),COLORBLUE;
上翘:IF(DIF>REF(DIF,1),DIF,NULL),COLORRED,LINETHICK3;
下拐:IF(DIF<REF(DIF,1),DIF,NULL),COLORBLUE,LINETHICK3;
//MACD背离
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,DEA*1.09,DEA*0.86,6,0),COLOR00FF00;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
DRAWTEXT(底背离,DEA*1.09,’ 底背离’),FONTSIZE18,COLORRED;
B1:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,B1+1)<CLOSE AND REF(DIF,B1+1)>DIF AND CROSS(DEA,DIF);
DRAWLINE(B1=0,DEA,顶背离,DEA,0),FONTSIZE18,COLORGREEN,LINETHICK1;
DRAWTEXT(顶背离,DEA*1.2,’ 顶背离’),FONTSIZE18,COLORBLACK;
//KDJ
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,9,3),COLORRED;
D:SMA(K,9,3),COLORCYAN;
J:3*K-2*D,COLORMAGENTA;
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);
A3:=BARSLAST(REF(CROSS(D,K),1));
B3:=REF(C,A2+1)<C AND REF(K,A2+1)>K AND CROSS(D,K);
A22:=IF(ABS(D)<ABS(0.6*DEA),0.6*D*ABS(DEA/D),0.95*D);
B4:=CROSS(DIF,DEA) AND CROSS(K,D);
DRAWTEXT(B4,DEA*1.2,’★金叉共振’),FONTSIZE18,COLORRED;
B5:=CROSS(DEA,DIF) AND CROSS(D,K);
DRAWTEXT(B5,DEA*1.2,’★死叉共振’),FONTSIZE18,COLORBLACK;
VERTLINE(CROSS(DIF,DEA),COLORRED),LINETHICK3;
VERTLINE(CROSS(DEA,DIF),COLORBLACK),LINETHICK3;
DRAWNUMBER(CROSSDOWN(DIF,DEA)&&DIF>0,DIF,SUM(CROSSDOWN(DIF,DEA),BARSLASTCOUNT(DIF>0)),0,COLORRED),FONTSIZE40;
DRAWNUMBER(CROSS(DIF,DEA)&&DIF<0,DIF,SUM(CROSS(DIF,DEA),BARSLASTCOUNT(DIF<0)),0,COLORBLACK),FONTSIZE40;
LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE – LC),0),5,1) / SMA(ABS((CLOSE – LC)),5,1)) * 100);
TR1:=SUM(MAX(MAX((HIGH – LOW),ABS((HIGH – REF(CLOSE,1)))),ABS((LOW – REF(CLOSE,1)))),10);
HD:=(HIGH – REF(HIGH,1));
LD:=(REF(LOW,1) – LOW);
DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);
PDI:=((DMP * 100) / TR1);
MDI:=((DMM * 100) / TR1);
ADX:=MA(((ABS((MDI – PDI)) / (MDI + PDI)) * 100),5);
AV:=(RSI5 + ADX);
DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);
0,COLORFF00FF;
WR10:=((100 * (HHV(HIGH,10) – CLOSE)) / (HHV(HIGH,10) – LLV(LOW,10)));
NEWVOL:=(RSI5 – WR10);
阶段底部:=(AV + NEWVOL);
趋势线:=LLV(阶段底部,1),COLORRED;
STICKLINE((趋势线 >230 ),100,90,0.3,0),LINETHICK6,COLORLIGHTGREEN;
LOWV:=LLV(LOW,9);
HIGHV:=HHV(HIGH,9);
POLYLINE(1,K,COLORLIGHTRED),LINETHICK2;
POLYLINE(1,D,COLORBLACK),LINETHICK2;
STICKLINE(K>D , K,D ,2.5,0),COLORMAGENTA;
STICKLINE(D>K,K,D,2.5,0),COLORLIGHTGREEN;
逃顶线:90,COLORBLUE,LINETHICK2;
中轴线: 50,COLORRED,LINETHICK2;
抄底线:10,COLORRED,LINETHICK2;
警戒:阶段底部 < 0,NODRAW,COLORYELLOW;
出击:CROSS(阶段底部,0),NODRAW,COLORRED;
VAR1:=(HHV(HIGH,13) – LLV(LOW,13));
VAR2:=(HHV(HIGH,13) – CLOSE);
VAR3:=(CLOSE – LLV(LOW,13));
VAR4:=(((VAR2 / VAR1) * 100) – 70);
VAR5:=(((CLOSE – LLV(LOW,60)) / (HHV(HIGH,60) – LLV(LOW,60))) * 100);
VAR6:=((((2 * CLOSE) + HIGH) + LOW) / 4);
VAR7:=SMA(((VAR3 / VAR1) * 100),3,1);
VAR8:=LLV(LOW,34);
VAR9:=(SMA(VAR7,3,1) – SMA(VAR4,9,1));
VAR10:=IF((VAR9 > 100),(VAR9 – 100),0);
VAR11:=HHV(HIGH,34);
VAR12:=EMA((((VAR6 – VAR8) / (VAR11 – VAR8)) * 100),13);
VAR13:=EMA(((0.667 * REF(VAR12,1)) + (0.333 * VAR12)),2);
STICKLINE(((VAR12 – VAR13) > 0),VAR12,VAR13,12,0), COLORRED;
STICKLINE(((VAR12 – VAR13) < 0),VAR12,VAR13,8,0), COLORBLUE;
低位绿变红看多:EMA(VAR13,5), COLORRED,LINETHICK4;
高位红变绿减仓:99, COLORBLUE;
DRAWCOLORLINE(低位绿变红看多>REF(低位绿变红看多,1),低位绿变红看多,COLORRED,COLORBLUE),LINETHICK4;
STICKLINE(CROSS((VAR12 – VAR13) > 0 && K>D,0.5),0,-10,0.8,0),COLORRED;
STICKLINE(CROSSDOWN(K,D) AND K>=50,100,90,COLORBLUE,0);
VERTLINE(VAR12>VAR13&&K>D,COLORRED),LINETHICK2;
倍量:=VOL>=REF(V,1)*1.8 AND C>REF(C,1);