趋势线指标公式和选股公式按要求合并成一个选股公式,

趋势线公式原码如下:
DRAWGBKLAST(CLOSE>0,STRIP(RGB(95,95,95),RGB(0,0,0),0));
ZF:=(C/REF(C,1)-1)*100;
趋势:SUM(ZF,3),COLORFFFFFF,LINETHICK2;
超涨:IF(MA(ZF,3)>=5,15,0),COLOR0000FF;
WK:=趋势=LLV(趋势,4) AND 趋势-HHV(趋势,4)<=0-20 AND HHV(趋势,4)>=8;
挖坑:IF(WK,0-10,0),COLOR00FFFF;
超跌:IF(MA(ZF,3)<=0-5,0-15,0),COLOR00FF00;
CZSJ:=BARSLAST(超涨=15);
CDSJ:=BARSLAST(超跌=0-15);
CZQY:=CZSJ<=8 AND CZSJ<=CDSJ AND COUNT(MA(趋势,3)>=0-5,CZSJ)=CZSJ;
CDQY:=CDSJ<=8 AND CDSJ<=CZSJ AND COUNT(MA(趋势,3)<=5,CDSJ)=CDSJ;
关注期:IF(CZQY,CZSJ+1,0),COLORFF00FF,POINTDOT;
跟踪期:IF(CDQY,0-CDSJ-1,0),COLORFF8800,POINTDOT;


选股公式原码如下:

XG: MA(C,20)>REF(MA(C,20),1) AND V/REF(V,1)>1 AND AMOUNT/CAPITAL*100>2 AND CROSS(C>MA(C,20),0.5)

请将以上两个公式合并成一个选股公式,要求:20日均线上行(量比大于1换手大于2)股价上穿20日均线且趋势线突破0轴线的选股公式。
 

 

 

解答如下:

ZF:=(C/REF(C,1)-1)*100;
趋势:=SUM(ZF,3);
超跌:=MA(ZF,3)<=0-5;
WK:=趋势=LLV(趋势,4) AND 趋势-HHV(趋势,4)<=0-20 AND HHV(趋势,4)>=8;
XG:WK OR MA(C,20)>REF(MA(C,20),1) AND V/REF(V,1)>1 AND AMOUNT/CAPITAL*100>2 AND CROSS(C>MA(C,20),0.5) OR 超跌;