首页 > 代码库 > 粗选公式-通达信
粗选公式-通达信
{R1剔除成交量过大}
TMP1_VOL_RATE:=0.9;{成交量比例}
TMP1_MA100:=MA(VOL, 30);{50日均成交量}
R1:=IF(V/TMP1_MA100<=TMP1_VOL_RATE,1,0);
{R3剔除跌幅过大}
T3_MAX:=0.06;{最大跌幅%}
T3_CLOSE_REF1:=REF(CLOSE, 1);{前一天收盘价}
T3_SUB:=CLOSE-T3_CLOSE_REF1;{收盘价-前一天收盘价}
R3:=IF(T3_SUB<0,IF((1-T3_SUB)/T3_CLOSE_REF1<T3_MAX,1,0),1);
{R4剔除涨幅过大}
T4_MAX:=0.03;{最大涨幅%}
T4_CLOSE_REF1:=REF(CLOSE, 1);{前一天收盘价}
T4_SUB:=CLOSE-T4_CLOSE_REF1;{收盘价-前一天收盘价}
R4:=IF(T4_SUB>0,IF(T4_SUB/T4_CLOSE_REF1<T4_MAX,1,0),1);
{R5剔除停牌股}
R5:=IF((DYNAINFO(4)>0),1,0);{开盘价}
{--R6实体线长度限制}
TMP6_PRICE_RATE:=0.03;{实体大小限制}
TMP6_SUB:=DYNAINFO(7)/DYNAINFO(4);{现价/开盘价}
TMP6_SUB2:=IF(TMP6_SUB < 1, 1-TMP6_SUB, TMP6_SUB-1);{考虑跌的情况}
R6:=IF ((TMP6_SUB2<=TMP6_PRICE_RATE),1,0);
{R7剔除大盘股}
TMP7_PRICE:=800;{单位:亿}
R7:=IF((FINANCE(40)<=TMP7_PRICE*100000000),1,0);
{--R8剔除次新股}
TMP8_DAYS:=100;
R8:=IF((FINANCE(42)>TMP8_DAYS),1,0);{上市天数}
{R9剔除换手率过大和过小}
TMP9_MIN:=0.002;
TMP9_MAX:=0.10;
R9_MIN:=IF(DYNAINFO(37)>TMP9_MIN, 1, 0);
R9_MAX:=IF(DYNAINFO(37)<=TMP9_MAX, 1, 0);
R9:=IF(R9_MIN AND R9_MAX, 1, 0);
{--R10剔除前一个交易日涨幅过大}
TMP10_MAX:=0.05;{涨幅限制}
R10:=IF(((REF(CLOSE,1)-REF(CLOSE, 2))/REF(CLOSE, 2)) < TMP10_MAX, 1, 0);
{--R11剔除前一个交易日跌幅过大}
TMP11_MAX:=-0.08;{跌幅限制}
R11:=IF(((REF(CLOSE,1)-REF(CLOSE, 2))/REF(CLOSE, 2)) > TMP11_MAX, 1, 0);
{R12剔除ST股}
R12:=IF(NAMELIKE(‘*‘),0,IF(NAMELIKE(‘S‘), 0, 1));
{R13均线比较}
T13_10:=MA(CLOSE,10);{10日均线}
T13_20:=MA(CLOSE,20);{20日均线}
R13:=IF(T13_10>=T13_20,1,0);
{总结果}
IF ((R1 AND R3 AND R4 AND R5 AND R7 AND R9 AND R12 AND R13), 1, 0);
粗选公式-通达信