以4/7為篩選股票基準日,所選的股票數共有16檔被選出,但經過比對所有線圖後,發現另有其它6檔符合條件卻未被選出,未被選出的股票代號如下2606、3062、3489、3689、4306、6264,程式碼如下
setbarfreq("D");
condition1=false;
condition2=false;
condition3=false;
condition4=false;
condition5=false;
value20=average(GetField("收盤價","W"),20); //20週均線
value120=average(GetField("收盤價","W"),120); //120週均線
value200=average(GetField("收盤價","W"),200); //200週均線
if value120<>0 and absvalue((close-value120)/value120)<=0.05 then
begin
if value200<>0 and ((value200-value120)/value200)>=0.2 then condition1=true;
if value200>value120 then condition2=true;
if close>5 then condition3=true;
if value20<=value120 then condition4=true;
if volume>20 then condition5=true;
ret = condition1 and condition2 and condition3 and condition4 and condition5 ;
end;
1 評論