明明設定是最低成交量1000張才觸發怎麽有些低於1000的就被觸發了,有些600多很扯,附檔為觸發標的,以下為脚本
input: length(20); setinputname(1,"均量期數");
input: VolumeXtime(6); setinputname(2,"量增倍數");
input: confirmVolume(1000); setinputname(3,"突破均量張數");
var: intrabarpersist oncePerBar(0);
settotalbar(3);
setbarback(Length);
once(volume > Average( volume[1],length)* VolumeXtime +confirmVolume and GetInfo("IsRealTime") = 1 and oncePerBar<> currentbar)
begin
ret=1;
Print(file("C:\print\print.log"),"時間:",FormatDate("yyyy/MM/dd", currentDate),FormatTime("HH:mm:ss", currentTime),"策略:","成交量突破6倍(2)","商品:",symbol,symbolName,"價格:",numToStr(close,2),"成交量:",numtostr(volume,0));oncePerBar= currentbar; //若當根Bar已經執行過,limit就會記錄當根Bar的編號避免再度執行。
oncePerBar= currentbar; //若當根Bar已經執行過,limit就會記錄當根Bar的編號避免再度執行。
end;
1 評論