比如一组日线价格,20,19,18,17,16,15,14,13,12,11,10,11,12。我先计算出最低价:10.然后要求把价格不超过10的1.3倍的交易日(13,12,11,10,12这几天价格的交易量相加)的交易量叠加。这个该怎么实现,需要用到goto吗?求范例
runmode:0;
ll:=llv(l,10);
n:=0;
for i=0 to 9 do begin
if l[barpos-i]<ll*1.3 then n:=n+vol[barpos-i];
end
n为所求值
提示这一行“if l[barpos-i]<ll*1.3 then n:=n+vol[barpos-i];” 数组越界

此主题相关图片如下:qq图片20160429160447.png
runmode:0;
ll:=llv(l,10);
n:=0;
for i=0 to 9 do begin
if l[barpos-i]<ll*1.3 then n:=n+vol[barpos-i];
end
n1:n;