a:=REF(CLOSE,1);
b:=CLOSE;
方向:=IF(BARPOS=0 and CLOSE>=OPEN,1,IF(BARPOS=0 and CLOSE
上拐点:=(方向=-1 and REF(方向,1)=1);
下拐点:=(方向=1 and REF(方向,1)=-1);
t1:=BArslAST(上拐点);
t2:=BARSLAST(下拐点);
趋势:=IF(b>REF(a,t1),1,IF(b
趋势1:=IF(趋势<>0,趋势,REF(趋势,BARSLAST(Abs(趋势)))),linethick0;
STICKLINE(趋势1,a,b,0,0),linethick1,coloryellow;
STICKLINE(趋势1=-1,a,b,0,0),linethick1,colorblue;
STICKLINE(趋势1=-1 and REF(趋势1,1)=1,a,REF(a,t2),0,1),linethick1,coloryellow;
STICKLINE(趋势1=1 and REF(趋势1,1)=-1,a,REF(a,t1),0,1),linethick1,colorblue;
DRAWSL(REF(趋势1,1)=-1,a,0,1,1),colorblue,linethick1;
DRAWSL(REF(趋势1,1)=1,a,0,1,1),coloryellow,linethick1;
选股:趋势1=1 and REF(趋势1=-1,1),linethick0;