欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 数组下标越界问题

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5818人关注过本帖树形打印复制链接

主题:数组下标越界问题

帅哥哟,离线,有人找我吗?
jinzhe
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:罗宾汉 帖子:46311 积分:50819 威望:0 精华:2 注册:2011/3/23 8:50:25
[求助]请老师改成金字塔格式的  发帖心情 Post By:2011/7/20 13:43:36    Post IP:58.246.57.26[显示全部帖子]


for i=1 to datacount do
begin
 q2h[i]:ref(high,2);
 q2l[i]:ref(low,2);
 dw[1]:=1;gw[1]:=1;
 dw[2]:=1;gw[2]:=1;
 dw[3]:=1;gw[3]:=1;
 dw[4]:=1;gw[4]:=1;
 if ref(high,2)>=ref(high,3) and ref(high,2)>=ref(high,4) and ref(high,2)>=ref(high,1) and ref(high,2)>=high and i>=5 then gw[i]:=q2h[i];
 if ref(high,2)<ref(high,3) and ref(high,2)<ref(high,4) and ref(high,2)<ref(high,1) and ref(high,2)<high and i>=5 then gw[i]:=gw[i-1];
 if ref(low,2)<=ref(low,3) and ref(low,2)<=ref(low,4) and ref(low,2)<=ref(low,1) and ref(low,2)<=low and i>=5 then dw[i]:=q2l[i];
 if ref(low,2)>ref(low,3) and ref(low,2)>ref(low,4) and ref(low,2)>ref(low,1) and ref(low,2)>low and i>=5 then dw[i]:=dw[i-1];

dd:dw;
gg:gw;
end

我把数组的前4赋值,以及把else的意思用if给表示了出来


金字塔—专业程序化交易量化投资平台

客户服务部

----------------------------------------------------------- 欢迎您参加我公司的技术培训,具体培训需求请发邮件到service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部