精心收集的几个选股公式(源码)
精心收集的几个选股公式源码如下:
{领头羊选股}
白色:=SMA(HIGH,21,2)*1.05,;
黄s:=SMA(LOW,21,2)*0.95;
粉色:=SMA(LOW,5,1);
绿色:=SMA(CLOSE,2,1),;
波段买入:=IF(CROSS(绿色,粉色),白色*1.05,粉色);
领头羊:=IF(CROSS(绿色,白色),白色*1.10,黄s);
领头羊>黄s OR 波段买入>粉色
{ 绿线上穿紫线时,可作波段买入,绿线上穿白线时很可能是大牛股。
可作为预警选股公式}
{结合寻找领头羊指标使用};
--------------------------------------------------------------------------------
{天堂星踏金浪1 选股}
VARC:=(2*CLOSE+HIGH+LOW)/4;
VARD:=LLV(LOW,34);
VARE:=HHV(HIGH,34);
VARF:=LLV(LOW,13);
VAR10:=HHV(HIGH,13);
VAR11:=EMA((VARC-VARF)/(VAR10-VARD)*100,5);
VAR12:=EMA((VARC-VARD)/(VARE-VARD)*100,8);
金浪:= VAR11;
AA:=EMA(VAR11,7);
海浪:= VAR12;
IF(CROSS(金浪,AA) AND AA<=25 ,1,0);
--------------------------------------------------------------------------------
{黑马绝技选股}
EMA13:=EMA(C,13);
EMA30:=EMA(C,30);
EMA60:=EMA(C,60);
EMA90:=EMA(C,90);
EMA120:=EMA(C,120);
EMA250:=EMA(C,250);
F1:=EMA30-EMA60<130/1000 AND EMA30-EMA90<230/1000 AND EMA30-EMA120<330/1000;
F2:=EMA60-EMA30<130/1000 AND EMA60-EMA90<230/1000 AND EMA60-EMA120<330/1000;
F3:=EMA90-EMA30<130/1000 AND EMA90-EMA60<230/1000 AND EMA90-EMA120<330/1000;
F4:=EMA120-EMA30<130/1000 AND EMA120-EMA60<230/1000 AND EMA120-EMA90<330/1000;
F5:=EMA30-EMA60<100/1000 AND EMA30-EMA90<200/1000;
FF1:=F1 AND F2 AND F3 AND F4 AND CROSS(EMA30,EMA60);
FF2:=F1 AND F2 AND F3 AND F4 AND CROSS(EMA(C,13),EMA30);
FF3:=F5 AND C>EMA250 AND CROSS(EMA30,EMA60);
G1:=EMA60-EMA90<220/1000 AND EMA60-EMA120<320/1000 AND EMA60-EMA250<420/1000;
G2:=EMA90-EMA30<220/1000 AND EMA90-EMA60<320/1000 AND EMA90-EMA250<420/1000;
G3:=EMA120-EMA60<220/1000 AND EMA120-EMA90<320/1000 AND EMA120-EMA250<420/1000;
G4:=EMA250-EMA60<220/1000 AND EMA250-EMA90<320/1000 AND EMA250-EMA120<420/1000;
GG1:=G1 AND G2 AND G3 AND G4 AND CROSS(EMA13,EMA30);
GG2:=G1 AND G2 AND G3 AND G4 AND CROSS(EMA30,EMA60);
FF1 OR FF2 OR FF3 OR GG1 OR GG2;
--------------------------------------------------------------------------------
{黑马起步选股 }
A1:=VOL=HHV(VOL,120);
A2:=CLOSE/OPEN>1.05;
TJ:=A1 AND A2;
TJ AND (REF(BARSLAST(TJ),1)>80 OR BARSSINCE(TJ)=0);
--------------------------------------------------------------------------------
{底背离 选股}
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
底背离:B1>0 OR B2>0 OR B3>0;
{集成了MACD、KDJ、RSI三个指标的底背离};
--------------------------------------------------------------------------------
{蓄势待发 选股}
V0:=EMA(C,5);
EMA10:=EMA(C,10);
EMA20:=EMA(C,20);
EMA30:=EMA(C,30);
EMA60:=EMA(C,60);
M1:=1000*EMA10/EMA60<=1015 AND 1000*EMA10/EMA60>=975;
M2:=1000*EMA20/EMA60<=1020 AND 1000*EMA20/EMA60>=980;
M3:=1000*EMA30/EMA60<=1015 AND 1000*EMA30/EMA60>=985;
M4:=M1 AND M2 AND M3 AND CROSS(V0,EMA10);
M5:=M1 AND M2 AND M3 AND CROSS(V0,EMA30);
T1:=1000*EMA10/EMA30<=1010 AND 1000*EMA10/EMA30>=990;
T2:=1000*EMA20/EMA30<=1010 AND 1000*EMA20/EMA30>=990;
T3:=T1 AND T2 AND CROSS(V0,EMA10);
T4:=T1 AND T2 AND CROSS(V0,EMA30);
M4 OR M5 OR T3 OR T4;
--------------------------------------------------------------------------------
{突破指标 选股}
{一是突破盘整;二是突破前高;三是突破评台}
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
W4 AND COUNT(W4,5)=1;
--------------------------------------------------------------------------------
{四线粘合 选股}
V0:=EMA(C,5);
V1:=EMA(C,10);
V2:=EMA(C,15);
V3:=EMA(C,30);
V4:=EMA(C,60);
M1:=1000*V1/V4<=1015 AND 1000*V1/V4>=975;
M2:=1000*V2/V4<=1020 AND 1000*V2/V4>=980;
M3:=1000*V3/V4<=1015 AND 1000*V3/V4>=985;
M4:=M1 AND M2 AND M3 AND CROSS(V0,V1);
M5:=M1 AND M2 AND M3 AND CROSS(V0,V3);
M4 OR M5;
--------------------------------------------------------------------------------
{拉升在即 选股}
ABV:=MA(SUM(IF(CLOSE>REF(CLOSE,1),VOL,IF(CLOSE<REF(CLOSE,1),-VOL,0)),0)/25000,2);
M1:=EMA(ABV,12);
M2:=EMA(ABV,26);
MTM:=CLOSE-REF(CLOSE,1);
MMS:=((100)*(EMA(EMA(MTM,6),6)))/(EMA(EMA(ABS(MTM),6),6));
MMM:=((100)*(EMA(EMA(MTM,12),12)))/(EMA(EMA(ABS(MTM),12),12));
MML:=((100)*(EMA(EMA(MTM,26),26)))/(EMA(EMA(ABS(MTM),26),26));
A:=((VOL)/(CAPITAL))*(100);
S:=((MA(A,30))/(MA(INDEXA,10)))*(MA(INDEXA,60));
Y:=((MA(A,120))/(MA(INDEXA,10)))*(MA(INDEXA,60));
X:=1;
拉升在即:S<X AND Y<X AND MMS>MML AND ABV>M1 AND CROSS(S,Y);
--------------------------------------------------------------------------------
{前导选股涨 }
NN1:=IF(LFM.N<1,1,LFM.N);
M1:=IF(NN1>30,30,NN1);
MM1:=IF(LFM.M>60,60,LFM.M);
M2:=IF(MM1>M1,MM1,(M1+1));
LFMTMP:=2*REF(CLOSE,M1)-REF(CLOSE,M2);
QDBTMP1:=(2*SUM(CLOSE,M1)+SUM(CLOSE,(M2-M1))-SUM(CLOSE,M2))/M1;
QDBTMP2:=(2*SUM(CLOSE,M2)+SUM(CLOSE,(M2-M1))-SUM(CLOSE,(2*M2-M1)))/M2;
QDBTMP:=QDBTMP1-QDBTMP2;
TMP1:=(LFMTMP<LOW);
TMP2:=((LFMTMP>=LOW)AND(LFMTMP<=HIGH));
TMP3:=BARSLAST(TMP2);
TMP4:=REF(TMP3,1);
TMP5:=(LFMTMP<REF(LFMTMP,(TMP4+1)));
TMP6:=((2*REF(CLOSE,1)-REF(CLOSE,(M2-M1+1)))<(2*CLOSE-REF(CLOSE,(M2-M1))));
TMP7:=((QDBTMP>REF(QDBTMP,1))AND(REF(QDBTMP,1)<REF(QDBTMP,2)));
TMP8:=((2*REF(CLOSE,1)-REF(CLOSE,(M2-M1+1)))<=(2*CLOSE-REF(CLOSE,(M2-M1))));
TMP9:=(OPEN<CLOSE);
前导选股:((TMP1)AND(TMP8)AND(TMP9))OR((TMP2)AND(TMP5)AND(TMP6)AND(TMP7)AND(TMP9));
--------------------------------------------------------------------------------
{前导选股跌}
NN1:=IF(LFM.N<1,1,LFM.N);
M1:=IF(NN1>30,30,NN1);
MM1:=IF(LFM.M>60,60,LFM.M);
M2:=IF(MM1>M1,MM1,(M1+1));
LFMTMP:=2*REF(CLOSE,M1)-REF(CLOSE,M2);
QDBTMP1:=(2*SUM(CLOSE,M1)+SUM(CLOSE,(M2-M1))-SUM(CLOSE,M2))/M1;
QDBTMP2:=(2*SUM(CLOSE,M2)+SUM(CLOSE,(M2-M1))-SUM(CLOSE,(2*M2-M1)))/M2;
QDBTMP:=QDBTMP1-QDBTMP2;
TMP1:=(LFMTMP>HIGH);
TMP2:=((LFMTMP>=LOW)AND(LFMTMP<=HIGH));
TMP3:=BARSLAST(TMP2);
TMP4:=REF(TMP3,1);
TMP5:=(LFMTMP>REF(LFMTMP,(TMP4+1)));
TM |