奇狐社區論壇
在這個頁面顯示本主題全部的 8 個文章

奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 問題交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=28)
-- [問題]指標未顯示? (http://www.chiefox.com.tw/bbs/showthread.php?threadid=17653)


由 Markchu7 在 2013-04-22 00:49 發表:

[問題]指標未顯示?

源碼(網路上下載):
INPUT:N(5,1,100);
fc:=c;
fo:=o;
cc:0*c,PRECISION4,LINETHICK0;
oo:0*c,PRECISION4,LINETHICK0;
t1:=0*c;
t2:=0*c;
for i=1 to datacount do begin
if i=1 and fc[i]>fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i=1 and fc[i]<fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i>1 then
cc[i]:=cc[i-1];
oo[i]:=oo[i-1];
if i>1 and fc[i]>cc[i]*(1+n/1000) then begin
cc[i]:=cc[i-1]*(1+n/1000);
oo[i]:=cc[i-1];
end;
if i>1 and fc[i]<oo[i]/(1+n/1000) then begin
oo[i]:=oo[i-1]/(1+n/1000);
cc[i]:=oo[i-1];
end;
if oo[i]=oo[i-1] then
t1[i]:=t1[i-1]+1;
if cc[i]=cc[i-1] then
t2[i]:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);
格子點數:abs(cc-oo),PRECISION4,linethick0;
STICKLINE(c1=oo,ref(cc,1),ref(oo,1),1,0)COLORRED;
STICKLINE(c1=oo,cc,oo,8,0)COLORRED;
STICKLINE(o1=cc,ref(cc,1),ref(oo,1),1,0)COLORBLUE;
STICKLINE(o1=cc,cc,oo,8,0)COLORBLUE;
有些股票可以顯示指標,有些卻不行,不知問題何在?


由 Markchu7 在 2013-04-22 00:50 發表:

2501


由 Markchu7 在 2013-04-22 00:51 發表:

2498


由 Markchu7 在 2013-04-22 00:52 發表:

2474


由 cgjj 在 2013-04-22 11:30 發表:

回覆: [問題]指標未顯示?

引用:
最初由 Markchu7 發表
源碼(網路上下載):
INPUT:N(5,1,100);
fc:=c;
fo:=o;
cc:0*c,PRECISION4,LINETHICK0;
...................................
有些股票可以顯示指標,有些卻不行,不知問題何在?



程式可能有些狀況沒考慮到或未正確處理
不知原始設計邏輯, 難以協助修正
請自行洽原作者詢問


由 Markchu7 在 2013-04-22 11:36 發表:

了解!感恩!


由 peter109 在 2013-04-27 15:11 發表:

回覆: [問題]指標未顯示?

引用:
最初由 Markchu7 發表
源碼(網路上下載):
INPUT:N(5,1,100);
fc:=c;
fo:=o;
cc:0*c,PRECISION4,LINETHICK0;
oo:0*c,PRECISION4,LINETHICK0;
t1:=0*c;
t2:=0*c;
for i=1 to datacount do begin
if i=1 and fc[i]>fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i=1 and fc[i]<fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i>1 then
cc[i]:=cc[i-1];
oo[i]:=oo[i-1];
if i>1 and fc[i]>cc[i]*(1+n/1000) then begin
cc[i]:=cc[i-1]*(1+n/1000);
oo[i]:=cc[i-1];
end;
if i>1 and fc[i]<oo[i]/(1+n/1000) then begin
oo[i]:=oo[i-1]/(1+n/1000);
cc[i]:=oo[i-1];
end;
if oo[i]=oo[i-1] then
t1[i]:=t1[i-1]+1;
if cc[i]=cc[i-1] then
t2[i]:=t2[i-1]+1;
end;
o1:=ref(oo,t1+1);
c1:=ref(cc,t2+1);
格子點數:abs(cc-oo),PRECISION4,linethick0;
STICKLINE(c1=oo,ref(cc,1),ref(oo,1),1,0)COLORRED;
STICKLINE(c1=oo,cc,oo,8,0)COLORRED;
STICKLINE(o1=cc,ref(cc,1),ref(oo,1),1,0)COLORBLUE;
STICKLINE(o1=cc,cc,oo,8,0)COLORBLUE;
有些股票可以顯示指標,有些卻不行,不知問題何在?



推測
原著漏掉考慮第一根K棒C=O的條件

if i=1 and fc[i]>fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
if i=1 and fc[i]<fo[i] then
cc[i]:=fc[i];
oo[i]:=fc[i];
改為
if i=1 then
cc[i]:=fc[i];
oo[i]:=fc[i];
就可正常顯示了

__________________
至誠能勝天下至偽
至拙能勝天下至巧


由 Markchu7 在 2013-04-27 22:59 發表:

感恩大哥的指導!來去試一試!


全部時間均為台灣時間, 現在時間為21:22
在這個頁面顯示本主題全部的 8 個文章


Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.

簡愛洋行 製作 Copyright 2003-. All Rights Reserved.