 |
tracy
資深會員
註冊日期: Jan 2004
來 自:
文章數量: 330 |
累積價量圖
累積價量圖MN_AVOL
概要
Y軸為交易價格, X軸為該價格之交易量,以此價格區間為支撐線或壓力線,依此做為買賣策略
公式
1.水平桿的數量= (區間的最高價與最低價的差) / n
以最高價或最低價為基準,加或除{(高價-低價)/n}值之後,計算區間。
2.水平桿的長度 –加上屬於各水平桿區的交易量之後,以最大的區間值為基準價。將基準價設定100,算出相對的長度。
這是日盛證券寫的公式原理,把一個區間的累積價量分佈做為參考。只是希望奇狐內也能列入在主圖內,用成交堆積的感覺太細也太不好看。
|
|
向版主報告此篇 |  |
|
2015-09-07 23:04 |
|
|
|  |
 |
cgjj
總版主

註冊日期: Oct 2003
來 自:
文章數量: 18091 |
重新寫了一個,應用上比較方便的。
(需搭配十字游標使用)
原碼: 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;
|
|
向版主報告此篇 |  |
|
2015-09-08 11:37 |
|
|
|  |
 |
mead
資深會員
註冊日期: Nov 2004
來 自: 台北
文章數量: 409 |
引用: 最初由 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那個樣子!
感恩
|
|
向版主報告此篇 |  |
|
2015-09-08 15:29 |
|
|
|  |
 |
mead
資深會員
註冊日期: Nov 2004
來 自: 台北
文章數量: 409 |
引用: 最初由 cgjj 發表
當然是可以做
但用處不大呀,所以把它忽略掉
MZ[n] 就是該數值,如有需要請自行添入
了解 謝謝板主回覆 感恩
我再自行加入
|
|
向版主報告此篇 |  |
|
2015-09-08 22:13 |
|
|
|  |
 |
Markchu7
資深會員
註冊日期: Nov 2007
來 自:
文章數量: 1496 |
請版主協助只需畫出排序1與排序2的彩帶且不需比例與張數!謝謝!
|
|
向版主報告此篇 |  |
|
2017-08-08 10:15 |
|
|
|  |
 |
cgjj
總版主

註冊日期: Oct 2003
來 自:
文章數量: 18091 |
引用: 最初由 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);
|
|
向版主報告此篇 |  |
|
2017-08-08 11:13 |
|
|
|  |
本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。
|
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved. 聯絡我們
|