小幫手好
我想在盤中(5分鐘k線圖) 挑出 預估量有超過( 5日均量或昨量 )的5倍,且ma10. ma50向上,盤整後開高不拉回的股票,我套用了一些搜尋到的腳本,程式碼如下
但今天盤中啟動使用,卻篩出預估量、 5日均量、昨量有低於1000張的股票,可以幫我看哪裡有錯嗎?
input: shortlength(10); setinputname(1,"短期均線期數");
input: Longlength(50); setinputname(2,"長期均線期數");
variable: Longaverage(0);
variable: shortaverage(0);
Longaverage = Average(close,Longlength); //50
shortaverage= Average(close,shortlength) ; //10
input:sp(1);
input:opl(2);
input:oph(4);
setinputname(1,"回檔最大幅度");
setinputname(2,"漲幅最小幅度");
setinputname(3,"開高最大幅度");
value15=getfield("close", "d")[1]; //前一日的收盤價
value16=getfield("close", "d")[3];
value1= xf_xaverage("d",GetField("Volume", "D")[1], 5);
value5= xf_xaverage("D",GetField("Volume", "D")[1], 60);
value6=GetField("Volume", "D")[1];
value2=q_EstimatedTotalVolume;//GetField("估計量")
value3=summation(volume, 15)*8;//前十五根一分鐘線成交量的合計的8倍
condition1 = value1 > 1000 ;//五日均量大於1000張
condition7 = value6 > 1000 ;//昨量大於1000張
condition2 = value3 >= value1 * 5;//前十五根一分鐘線成交量合計的8倍大於五日均量5倍
condition4 = value3 >= value5 * 5;//前十五根一分鐘線成交量合計的8倍大於季均量5倍
condition8 = value3 >= value6 * 5;//前十五根一分鐘線成交量合計的8倍大於昨量5倍
condition3 = value2 >= value1 *5;
condition5 = value2 >= value5 *5;
condition6 = value2 >= value6 *5;
if currentdate <> date then return;
if time = 090500 then
begin
value11 = getfield("open","5")[1];//第一根5分K開盤價
value12 = getfield("high","5")[1];//第一根5分K最高價
value13 = getfield("low","5")[1];//第一根5分K最低價
value14 = getfield("close","5")[1];//第一根5分K收盤價
end;
if time>0905
then
begin
if close>=value15*(1+opl/100)//1.漲幅超過2%,但沒有超過4%。
and close<=value15*(1+oph/100)
and low>high*(1-sp/100)//2.九點五分之後 從最高價拉回幅度不超過1%。
and close=high//4.現在股價突破開盤價達今日最高價
and value15<value16*1.04//3.過去三天股價漲幅沒有超過4%
then ret=1;
end;
if condition1=true
and condition7=true
and (condition2 or condition3 or condition4 or condition5 or condition6 or condition8)
and Longaverage[0]>Longaverage[1]
and shortaverage[0]>shortaverage[1]
and shortaverage > Longaverage
and close > shortaverage
then ret=1;
5 評論