想詢問設定最低觸發張數 為1000張,但策略在跑時沒有超過1000張也會觸發
不確定下面語法哪裡有錯,感謝回復!!
input: Length(20); setinputname(1,"計算期數");
input: VLength(10); setinputname(2,"均量期數");
input: volpercent(50); setinputname(3,"爆量增幅%");
input: Rate(5); setinputname(4,"離低點幅度%");
input:XLimit(True); setinputname(5,"限制最低觸發門檻");
input:atVolume(1000); setinputname(6,"最低觸發張數");
input:percent(100); setinputname(7,"量增比例%");
settotalbar(Length + 3);
setbarback(maxlist(Length,VLength));
if Close > Close[1] and
Volume >= average(volume,VLength) *(1+ volpercent/100) and
Close <= lowest(close,Length) * (1+Rate/100)
then ret=1;
variable: AvgVolume(0);
AvgVolume=Average(volume,Length);
if XLimit then
begin
if Volume > atVolume and volume > AvgVolume *(1+ percent/100) then ret=1;
end
else
begin
if Volume > Volume[1] and volume > AvgVolume *(1+ percent/100) then ret=1;
end;
3 評論