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

奇狐社區論壇 (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=19413)


由 tracy 在 2015-08-21 15:04 發表:

[公式]請問奇狐公式問題?

請問奇狐內有沒有相關價量分布的公式,如日盛證券的HTS內就有這種公能放在主圖上可以清楚看到價量分佈的情形,雖然是移動的但可以做為參考,請問有嗎?目前都找不到?謝謝!


由 cgjj 在 2015-08-21 15:24 發表:

回覆: [公式]請問奇狐公式問題?

引用:
最初由 tracy 發表
請問奇狐內有沒有相關價量分布的公式,如日盛證券的HTS內就有這種公能放在主圖上可以清楚看到價量分佈的情形,雖然是移動的但可以做為參考,請問有嗎?目前都找不到?謝謝!


於K線圖按滑鼠右鍵,選擇[成交堆積] 即可觀看

另外,這邊也有類似的應用公式,可以參考看看
http://www.chiefox.com.tw/bbs/showt...&threadid=17301


由 cyberpeace 在 2015-08-21 17:05 發表:

大大也可以參考這個看看,

http://www.chiefox.com.tw/bbs/showt...A5%BB%A4%C0%AAR


由 cyberpeace 在 2015-08-21 17:36 發表:

如圖2409


由 tracy 在 2015-09-07 23:04 發表:

累積價量圖

累積價量圖MN_AVOL

概要

Y軸為交易價格, X軸為該價格之交易量,以此價格區間為支撐線或壓力線,依此做為買賣策略

公式

1.水平桿的數量= (區間的最高價與最低價的差) / n

以最高價或最低價為基準,加或除{(高價-低價)/n}值之後,計算區間。

2.水平桿的長度 –加上屬於各水平桿區的交易量之後,以最大的區間值為基準價。將基準價設定100,算出相對的長度。

這是日盛證券寫的公式原理,把一個區間的累積價量分佈做為參考。只是希望奇狐內也能列入在主圖內,用成交堆積的感覺太細也太不好看。


由 cgjj 在 2015-09-08 08:44 發表:

引用:
最初由 tracy 發表
累積價量圖

累積價量圖MN_AVOL

概要

Y軸為交易價格, X軸為該價格之交易量,以此價格區間為支撐線或壓力線,依此做為買賣策略

公式

1.水平桿的數量= (區間的最高價與最低價的差) / n

以最高價或最低價為基準,加或除{(高價-低價)/n}值之後,計算區間。

2.水平桿的長度 –加上屬於各水平桿區的交易量之後,以最大的區間值為基準價。將基準價設定100,算出相對的長度。

這是日盛證券寫的公式原理,把一個區間的累積價量分佈做為參考。只是希望奇狐內也能列入在主圖內,用成交堆積的感覺太細也太不好看。



前面 cyberpeace 回覆之連結的公式,不就是了嗎?


由 cgjj 在 2015-09-08 11:37 發表:

重新寫了一個,應用上比較方便的。
(需搭配十字游標使用)

原碼:
N:=10; CC:=C; VV:=V; KL:=SYSPARAM(2); KR:=SYSPARAM(3); KN:=barpos-KL; KZ:=KR-KL; PH:=SYSPARAM(4); PS:=(SYSPARAM(4)-SYSPARAM(5))/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; FILLRGN(ML[01]>=KN/KZ,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;


由 tracy 在 2015-09-08 12:35 發表:

謝謝,謝謝,謝謝!因為很重要所以說三次!


由 cyberpeace 在 2015-09-08 12:55 發表:

總版主高德惠澤狐友, 末學感恩您!


由 cgjj 在 2015-09-08 13:10 發表:

不客氣 ^_^


由 mead 在 2015-09-08 15:29 發表:

引用:
最初由 cgjj 發表
重新寫了一個,應用上比較方便的。
(需搭配十字游標使用)

原碼:
N:=10; CC:=C; VV:=V; KL:=SYSPARAM(2); KR:=SYSPARAM(3); KN:=barpos-KL; KZ:=KR-KL; PH:=SYSPARAM(4); PS:=(SYSPARAM(4)-SYSPARAM(5))/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; FILLRGN(ML[01]>=KN/KZ,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;



謝謝總板主提供

不知能不能在百分比前面秀張數?就如HTS那個樣子!

感恩


由 cgjj 在 2015-09-08 15:54 發表:

引用:
最初由 mead 發表
謝謝總板主提供

不知能不能在百分比前面秀張數?就如HTS那個樣子!

感恩



當然是可以做
但用處不大呀,所以把它忽略掉

MZ[n] 就是該數值,如有需要請自行添入


由 mead 在 2015-09-08 22:13 發表:

引用:
最初由 cgjj 發表
當然是可以做
但用處不大呀,所以把它忽略掉

MZ[n] 就是該數值,如有需要請自行添入



了解 謝謝板主回覆 感恩

我再自行加入


由 Markchu7 在 2017-08-08 10:15 發表:

請版主協助只需畫出排序1與排序2的彩帶且不需比例與張數!謝謝!


由 cgjj 在 2017-08-08 11:13 發表:

引用:
最初由 Markchu7 發表
請版主協助只需畫出排序1與排序2的彩帶且不需比例與張數!謝謝!


原碼:
N:=10; CC:=C; VV:=V; KL:=SYSPARAM(2); KR:=SYSPARAM(3); KN:=barpos-KL; KZ:=KR-KL; PH:=SYSPARAM(4); PS:=(SYSPARAM(4)-SYSPARAM(5))/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; VARIABLE:SMZ[N]=0; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; SMZ[i]:=ML[i]; end; x:=SORTPOS(SMZ,1,1,10); Z1:=SMZ[1]; Z2:=SMZ[2]; FILLRGN(ML[Z1]>=KN/KZ,MH[Z1],MH[Z1]-PS) color555555; FILLRGN(ML[Z2]>=KN/KZ,MH[Z2],MH[Z2]-PS) color888888; kline(O,H,L,C,0);


由 Markchu7 在 2017-08-08 11:28 發表:

感謝奇狐團隊快速周到的優質服務!


由 cgjj 在 2017-08-08 16:06 發表:

不客氣^^


由 mead 在 2017-08-09 21:03 發表:

引用:
最初由 cgjj 發表
不客氣^^

請問版主
如果要統計近60根K的成交累計要如何改?

謝謝 感恩


由 cgjj 在 2017-08-10 09:01 發表:

引用:
最初由 mead 發表
請問版主
如果要統計近60根K的成交累計要如何改?

謝謝 感恩



原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; DW:=barpos>KL; FILLRGN(ML[01]>=KN/KZ and DW,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and DW,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and DW,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and DW,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and DW,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and DW,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and DW,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and DW,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and DW,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and DW,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;


由 mead 在 2017-08-10 10:41 發表:

引用:
最初由 cgjj 發表
原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; DW:=barpos>KL; FILLRGN(ML[01]>=KN/KZ and DW,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and DW,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and DW,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and DW,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and DW,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and DW,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and DW,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and DW,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and DW,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and DW,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;


謝謝版主
感恩


由 Rosetta 在 2018-06-06 09:00 發表:

引用:
最初由 cgjj 發表
原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; DW:=barpos>KL; FILLRGN(ML[01]>=KN/KZ and DW,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and DW,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and DW,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and DW,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and DW,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and DW,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and DW,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and DW,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and DW,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and DW,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;



請問版主,若是以此做條件選股,條件是:今天收盤在百分比最大的那一根之區間內,該如何寫?


由 cgjj 在 2018-06-06 09:34 發表:

引用:
最初由 Rosetta 發表
請問版主,若是以此做條件選股,條件是:今天收盤在百分比最大的那一根之區間內,該如何寫?


原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; MaxNo:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then begin MaxMZ:=MZ[i]; MaxNo:=i; end; end; C<=MH[MaxNo] and C>=MH[MaxNo]-PS;


由 Rosetta 在 2018-06-06 21:56 發表:

引用:
最初由 cgjj 發表
原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; MaxNo:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then begin MaxMZ:=MZ[i]; MaxNo:=i; end; end; C<=MH[MaxNo] and C>=MH[MaxNo]-PS;



感謝版主指導


由 Rosetta 在 2021-07-26 11:41 發表:

引用:
最初由 cgjj 發表
原碼:
N:=10; CC:=C; VV:=V; KK:=60; KL:=datacount-KK+1; KR:=datacount; if KR<KK then exit; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,60); PH:=PH[datacount]; PL:=LLV(L,60); PL:=PL[datacount]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0; PS2:=PS/2; VZ:=0; MaxMZ:=0; for i=1 to N do begin MH[i]:=PH-PS*(i-1); for k=KL to KR do begin if CC[k]<=MH[i] and CC[k]>MH[i]-PS-PS*(i=N) then MZ[i]:=MZ[i]+VV[k]; end; VZ:=VZ+MZ[i]; if MZ[i]>MaxMZ then MaxMZ:=MZ[i]; end; for i=1 to N do begin ML[i]:=MZ[i]/MaxMZ; MP[i]:=MZ[i]/VZ*100; end; DW:=barpos>KL; FILLRGN(ML[01]>=KN/KZ and DW,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and DW,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and DW,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and DW,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and DW,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and DW,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and DW,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and DW,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and DW,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and DW,MH[10],MH[10]-PS) color888888; kline(O,H,L,C,0); RT:=barpos<KL+KZ*0.25; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=0,MH[01]-PS2,numtostr(MP[01],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=0,MH[02]-PS2,numtostr(MP[02],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=0,MH[03]-PS2,numtostr(MP[03],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=0,MH[04]-PS2,numtostr(MP[04],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=0,MH[05]-PS2,numtostr(MP[05],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=0,MH[06]-PS2,numtostr(MP[06],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=0,MH[07]-PS2,numtostr(MP[07],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=0,MH[08]-PS2,numtostr(MP[08],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=0,MH[09]-PS2,numtostr(MP[09],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=0,MH[10]-PS2,numtostr(MP[10],2)+'% ') ALIGN2 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[01]) and RT=1,MH[01]-PS2,' '+numtostr(MP[01],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[02]) and RT=1,MH[02]-PS2,' '+numtostr(MP[02],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[03]) and RT=1,MH[03]-PS2,' '+numtostr(MP[03],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[04]) and RT=1,MH[04]-PS2,' '+numtostr(MP[04],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[05]) and RT=1,MH[05]-PS2,' '+numtostr(MP[05],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[06]) and RT=1,MH[06]-PS2,' '+numtostr(MP[06],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[07]) and RT=1,MH[07]-PS2,' '+numtostr(MP[07],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[08]) and RT=1,MH[08]-PS2,' '+numtostr(MP[08],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[09]) and RT=1,MH[09]-PS2,' '+numtostr(MP[09],2)+'%') ALIGN1 pxup8 coloryellow; DRAWTEXT(barpos=KL+floor(KZ*ML[10]) and RT=1,MH[10]-PS2,' '+numtostr(MP[10],2)+'%') ALIGN1 pxup8 coloryellow;



請問版主,有沒有辦法將程式改成自訂某一個時間區段,例如2021/05/13到2021/06/17,謝謝


由 cgjj 在 2021-07-26 11:58 發表:

引用:
最初由 Rosetta 發表
請問版主,有沒有辦法將程式改成自訂某一個時間區段,例如2021/05/13到2021/06/17,謝謝


用訓練模式把時間倒退到2021/06/17
再將60調整為相對應的K棒數就可以了


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


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

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