这个指标组合主要用来捕捉股票底背离信号。当价格创新低但技术指标(MACD、KDJ、RSI等)不创新低时,就形成底背离,暗示可能见底反弹。操作策略很简单:当综合评分PF≥5分时(出现5个以上底背离信号),就是买入机会。具体看9个条件:MACD/KDJ/RSI/成交量/布林带/均线/CCI/OBV/WR的底背离,每满足1个加1分。黄色数字显示当前总分数,红色"背离大5"提示强势买入信号。简单说就是"多指标共振底背离时买入"。
N1:=10;
N2:=20;
N3:=30;
{MACD底背离}
COND1:=LLV(CLOSE,N3)=LLV(CLOSE,N1) AND
MACD.MACD>REF(MACD.MACD,N1) AND
CLOSE<=LLV(CLOSE,N1);
{KDJ底背离}
RSV:=(CLOSE-LLV(LOW,N2))/(HHV(HIGH,N2)-LLV(LOW,N2))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
COND2:=LLV(CLOSE,N2)=LLV(CLOSE,N1) AND
J>REF(J,N1) AND
CLOSE<=LLV(CLOSE,N1);
{RSI底背离}
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
COND3:=LLV(CLOSE,N3)=LLV(CLOSE,N1) AND
RSI1>REF(RSI1,N1) AND
CLOSE<=LLV(CLOSE,N1);
{成交量底背离}
COND4:=LLV(CLOSE,N2)=LLV(CLOSE,N1) AND
VOL>REF(VOL,N1)*1.5 AND
CLOSE<=LLV(CLOSE,N1);
{布林带底背离}
MID:=MA(CLOSE,20);
TMP2:=STD(CLOSE,20);
TOP:=MID+2*TMP2;
BOT:=MID-2*TMP2;
COND5:=CLOSE<BOT AND
CLOSE>REF(CLOSE,N1) AND
BOT>REF(BOT,N1);
{均线偏离度背离}
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
COND6:=CLOSE/MA20<0.9 AND
CLOSE/MA10>REF(CLOSE/MA10,N1);
{CCI底背离}
TYP:=(HIGH+LOW+CLOSE)/3;
CCI:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
COND7:=CCI>-100 AND
CCI>REF(CCI,N1) AND
CLOSE<=LLV(CLOSE,N1);
{ OBV底背离}
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV:=SUM(VA,0);
COND8:=LLV(CLOSE,N2)=LLV(CLOSE,N1) AND
OBV>REF(OBV,N1) AND
CLOSE<=LLV(CLOSE,N1);
{WR底背离}
WR1:=100*(HHV(HIGH,N1)-CLOSE)/(HHV(HIGH,N1)-LLV(LOW,N1));
COND9:=WR1>80 AND
WR1<REF(WR1,N1) AND
CLOSE<=LLV(CLOSE,N1);
{综合评分(0-9分)}
7,COLORBLACK;
PF:COND1+COND2+COND3+COND4+COND5+COND6+COND7+COND8+COND9,COLORWHITE,LINETHICK2;
PJMA:MA(PF,10),COLORYELLOW,LINETHICK2;
DRAWICON(PF>=5,PF,1);
DRAWTEXT(PF>=5,PF,'背离大5'),COLORRED;
DRAWNUMBER( PF>=1,PF,PF),COLORYELLOW;