![]() |
在這個頁面顯示本主題全部的 21 個文章 |
奇狐社區論壇 (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=4946)
日期可以運算嗎?
如何寫出程式:
請教從歷史高點開始, 每隔30, 55, 120, 200天劃出垂直虛線;並於圖底下標示30 55 120 200 數字,
以上;一直循環劃出直到圖行末端可能延伸看到位子止.
謝謝!!
以30天為例
h1:=hhv(h,0);
hh:h1[datacount],linethick0;
bh:=barslast(h=hh);
m:=mod(bh,30);
vertline(m=0);
drawtext(m=0,c,'30'),align5;
多謝 kkkkkk 快速回應,
今日之後的指標不會延序顯示 (至少延序1, 2 組或無限延伸可以嗎?
謝謝!!
可以,往前多算2組再shift2可往後推2個周期,餘可類推,但是沒有永遠這回事,因為K線畫面右移有限,你試試看
KKKKK 請 往前多算2組再shift2可往後推2個周期,餘可類推
FORMULA??
謝謝!!
引用:
最初由 lin123 發表
KKKKK 請 往前多算2組再shift2可往後推2個周期,餘可類推
FORMULA??
謝謝!!
![]()
多謝 KKKKK 指教,
以了解完成.
請問cgjj總版主,在畫完第四根線以後要如何把k歸0,並把迴圈返回起點重新再一次循環? (像 dBase 裡的 do procedure xxx , loop等)
w:barslast(h=hhv(h,0)),linethick0;
vertline(barpos=datacount-w[datacount]),colorred;
P:=C;
k:=1;
for i=datacount-w[datacount] to datacount do begin
if p[i]>0 then
k:=k+1;
if k=30 then begin
vertline(barpos=i),colorwhite;
drawnumber(barpos=i,c,30,0),align5,colorwhite;
end;
else if k=55 then begin
vertline(barpos=i),colormagenta;
drawnumber(barpos=i,c,55,0),align5,colormagenta;
end;
else if k=120 then begin
vertline(barpos=i),coloryellow;
drawnumber(barpos=i,c,120,0),align5,coloryellow;
end;
else if k=200 then begin
vertline(barpos=i),colorgreen;
drawnumber(barpos=i,c,200,0),align5,colorgreen;
end;
else if k=201 then
k=1;
end;
提示一下
可以利用餘數的特性喔
跑跑這行,就能體會
mod(barpos,200);
大概應該可以做出來吧,劍術精華就在一字之訣,還是版主高人,繼續試試看
終於鑽出牛角尖了,真是一語驚醒夢中人,謝謝cgjj總版主
h1:=hhv(h,0);
hh:=h1[datacount],linethick0;
bh:barslast(h=hh),linethick0;
m:mod(bh,200),linethick0;
vertline(bh=0 and m=0),colorred;
drawnumber(bh=0 and m=0,c,0,0),colorred,align5;
vertline(m=199),colorwhite;
drawnumber(m=0,c,200,0),colorwhite,align5;
vertline(m=29),coloryellow;
drawnumber(m=29,c,30,0),coloryellow,align5;
vertline(m=54),colormagenta;
drawnumber(m=54,c,55,0),colormagenta,align5;
vertline(m=119),colormagenta;
drawnumber(m=119,c,120,0),colormagenta,align5;
厲害, 厲害
趁這個機會在請教一下總版主,像我上面那個用循環語句作的式子,如果不用VB script,在奇狐內建的循環控制語法中,要如何才能實現類似 For....next, do loop 等的結果呢?
請版主在有空時指導一下,感激不盡
PAPAPA.....
謝謝 總版主及KKKKKK
"一字訣" 真精簡
引用:
最初由 kkkkkk 發表
趁這個機會在請教一下總版主,像我上面那個用循環語句作的式子,如果不用VB script,在奇狐內建的循環控制語法中,要如何才能實現類似 For....next, do loop 等的結果呢?
請版主在有空時指導一下,感激不盡
原碼:
h1:=hhv(h,0);
hh:=h1[datacount],linethick0;
bh:barslast(h=hh),linethick0;
ct:0;
m:=c*0;
for i=datacount-bh[datacount] to datacount do begin
ct:=mod(ct+1,200);
if ct=30 then m[i]:=30;
if ct=55 then m[i]:=55;
if ct=120 then m[i]:=120;
if ct=0 then m[i]:=200;
end;
vertline(bh=0),colorred;
vertline(m=200), colorwhite;
drawnumber(m=200,c,200,0),colorwhite,align5;
vertline(m=30),coloryellow;
drawnumber(m=30,c,30,0),coloryellow,align5;
vertline(m=55),colormagenta;
drawnumber(m=55,c,55,0),colormagenta,align5;
vertline(m=120),colormagenta;
drawnumber(m=120,c,120,0),colormagenta,align5;
真是條條大路通羅馬,謝謝cgjj總版主,且收入教材,捧燈夜讀
原碼:--------------------------------------------------------------------------------
h1:=hhv(h,0);
hh:=h1[datacount],linethick0;
bh:barslast(h=hh),linethick0;
ct:0;
m:=c*0;
for i=datacount-bh[datacount] to datacount do begin
ct:=mod(ct+1,200);
if ct=30 then m[i]:=30;
if ct=55 then m[i]:=55;
if ct=120 then m[i]:=120;
if ct=0 then m[i]:=200;
end;
vertline(bh=0),colorred;
vertline(m=200), colorwhite;
drawnumber(m=200,c,200,0),colorwhite,align5;
vertline(m=30),coloryellow;
drawnumber(m=30,c,30,0),coloryellow,align5;
vertline(m=55),colormagenta;
drawnumber(m=55,c,55,0),colormagenta,align5;
vertline(m=120),colormagenta;
drawnumber(m=120,c,120,0),colormagenta,align5;
cgjj 版大,
如何 shift 才能辦到往後再劃一組
試了多次shift , 對不到位子??
謝謝!!
i=datacount-bh[datacount]-200
每個畫線再shift200
KKKKKK,
THANK YOU!!
请问?如果是股票上市以来,并按3 . 5. 8. 13. 21. 34. 55. 89. 144. 233. 377划线,该怎样写.
引用:
最初由 jiat 發表
请问?如果是股票上市以来,并按3 . 5. 8. 13. 21. 34. 55. 89. 144. 233. 377划线,该怎样写.
全部時間均為台灣時間, 現在時間為22:19 | 在這個頁面顯示本主題全部的 21 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.