![]() |
在這個頁面顯示本主題全部的 2 個文章 |
奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- [求救]換成5.2, 公式出現BUG- 指標越界或超出有效區間 (http://www.chiefox.com.tw/bbs/showthread.php?threadid=22616)
[求救]換成5.2, 公式出現BUG- 指標越界或超出有效區間
Any one could help:
cc:=CLOSE;
oo:=OPEN;
hh:=HIGH;
ll:=LOW;
top:=HIGH;
bot:=LOW;
xx[1]:=1;
kk:=1;
for i=1 to DATACOUNT do begin IF xx[i]=1 then begin top[i]:=hh[i];
end;
IF xx[i-1]=1 then begin IF hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
xx[i]:=2;
end;
end;
IF xx[i-1]=2 then begin IF hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
bot[i]:=ll[i];
xx[i]:=3;
end;
end;
IF xx[i-1]=3 then begin top[i]:=top[i-1];
IF ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=4;
end;
end;
IF xx[i-1]=4 then begin top[i]:=top[i-1];
IF ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=5;
end;
end;
IF xx[i-1]=5 then begin IF ll[i]<bot[i-1] or hh[i]>top[i-1] then begin top[i]:=hh[i];
bot[i]:=hh[i];
xx[i]:=1;
end;
else begin bot[i]:=bot[i-1];
top[i]:=top[i-1];
xx[i]:=5;
end;
end;
end;
for j=1 to DATACOUNT do begin IF xx[j]=5 and xx[j-1]=4 then begin for k=j-1 downto j-kk do begin top[k]:=top[j];
bot[k]:=bot[j];
end;
end;
IF xx[j-1]=5 and xx[j]=1 then kk:=0;
kk:=kk+1;
end;
回覆: [求救]換成5.2, 公式出現BUG- 指標越界或超出有效區間
引用:
最初由 亞當理論 發表
Any one could help:
cc:=CLOSE;
oo:=OPEN;
hh:=HIGH;
ll:=LOW;
top:=HIGH;
bot:=LOW;
xx[1]:=1;
kk:=1;
for i=1 to DATACOUNT do begin IF xx[i]=1 then begin top[i]:=hh[i];
end;
IF xx[i-1]=1 then begin IF hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
xx[i]:=2;
end;
end;
IF xx[i-1]=2 then begin IF hh[i]>top[i-1] then begin top[i]:=hh[i];
xx[i]:=1;
end;
else begin top[i]:=top[i-1];
bot[i]:=ll[i];
xx[i]:=3;
end;
end;
IF xx[i-1]=3 then begin top[i]:=top[i-1];
IF ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=4;
end;
end;
IF xx[i-1]=4 then begin top[i]:=top[i-1];
IF ll[i]<bot[i-1] then begin bot[i]:=ll[i];
xx[i]:=3;
end;
else begin bot[i]:=bot[i-1];
xx[i]:=5;
end;
end;
IF xx[i-1]=5 then begin IF ll[i]<bot[i-1] or hh[i]>top[i-1] then begin top[i]:=hh[i];
bot[i]:=hh[i];
xx[i]:=1;
end;
else begin bot[i]:=bot[i-1];
top[i]:=top[i-1];
xx[i]:=5;
end;
end;
end;
for j=1 to DATACOUNT do begin IF xx[j]=5 and xx[j-1]=4 then begin for k=j-1 downto j-kk do begin top[k]:=top[j];
bot[k]:=bot[j];
end;
end;
IF xx[j-1]=5 and xx[j]=1 then kk:=0;
kk:=kk+1;
end;
| 全部時間均為台灣時間, 現在時間為14:15 | 在這個頁面顯示本主題全部的 2 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.