 |
Markchu7
資深會員
註冊日期: Nov 2007
來 自:
文章數量: 1518 |
[問題]指標未顯示?
源碼(網路上下載):
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:49 |
|
|
|  |
 |
peter109
資深會員
註冊日期: Dec 2004
來 自: Taipei
文章數量: 1891 |
回覆: [問題]指標未顯示?
引用: 最初由 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];
就可正常顯示了
__________________
至誠能勝天下至偽
至拙能勝天下至巧
|
|
向版主報告此篇 |  |
|
2013-04-27 15:11 |
|
|
|  |
本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。
|
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved. 聯絡我們
|