这几天大盘一直横盘.而个股却不断下跌.原来的选股公式好多.已不好用.其测试成功率也大大降低.进一步发现原来设参数的公式这回大有用处.可以随机而变.比如【4个背离】中
【KDJ 的D<N】的N当时N=20根本选不出来股票.现在该为N=10也能选出来而且成功率还大大的提高了
我旧话重提的目的就是想说.我们今后选股公式一定得随趋势的变化而变化.不能拿一个公式一搬到底.一成不变.用下去.把他搬出来,就是再一次证明这个问题.选股公式一定要设参数.
用的时侯时时都要变才行.【事关重大我不得不再一次提醒大家】如果你原来有就不必再下载了.
{底背离}
INPUT:N(20,0,80);
{1.MACD}
DIFF :=EMA(CLOSE,7) - EMA(CLOSE,13);
DEA := EMA(DIFF,3);
MACD := 2*(DIFF-DEA);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);{MACD底背离}
{2.KDJ}
RSV:=(CLOSE-LLV(LOW,18))/(HHV(HIGH,18)-LLV(LOW,18))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
A2:=BARSLAST(REF(CROSS(K,D),1));
B2:=REF(C,A2+1)>C AND REF(K,A2+1)<K AND CROSS(K,D);{KDJ底背离}
{3.RSI}
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1));
B3:=REF(C,A3+1)>C AND REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);{RSI底背离}
{4.CCI}
TYB:= (HIGH + LOW + 2*CLOSE)/4;
CCI4:=(TYB-MA(TYB,28))/(0.015*AVEDEV(TYB,28));
B4:=LAST(MA(C,5)<MA(C,10)<=5) AND CCI4>REF(CCI4,1) AND CROSS(CCI4,-100); { CCI底背离'}
XG:((B1 AND B2) OR (B2 AND B3) OR (B1 AND B3) OR ( B4 AND CCI4<-90) ) AND D<N ;