![]() |
總頁數 (3): [1] 2 3 » 在這個頁面顯示本主題全部的 41 個文章 |
奇狐社區論壇 (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=22396)
[問題]主圖疊加成交量橫條圖
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;
以上是總版主寫的主圖疊加成交量橫條圖的公式!
當沖:=(DATATYPE<>12 AND ISREGULARFBAR) or TRADEDATE<>REF(TRADEDATE,1) or BARPOS=1 OR (DATATYPE=12 AND TIME=084520),LINETHICK;
SP:=BARSLAST(當沖)+1,LINETHICK;
MM:=IF(SP<=SYSPARAM(3)-SYSPARAM(2),SP,SYSPARAM(3)-SYSPARAM(2));
請問公式可以修改成
1.成交量由MM開始統計!
2.橫條圖的範圍為HHV(H,MM)~LLV(L,MM)!
請協助,謝謝!
回覆: [問題]主圖疊加成交量橫條圖
引用:
最初由 Markchu7 發表
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;
以上是總版主寫的主圖疊加成交量橫條圖的公式!
當沖:=(DATATYPE<>12 AND ISREGULARFBAR) or TRADEDATE<>REF(TRADEDATE,1) or BARPOS=1 OR (DATATYPE=12 AND TIME=084520),LINETHICK;
SP:=BARSLAST(當沖)+1,LINETHICK;
MM:=IF(SP<=SYSPARAM(3)-SYSPARAM(2),SP,SYSPARAM(3)-SYSPARAM(2));
請問公式可以修改成
1.成交量由MM開始統計!
2.橫條圖的範圍為HHV(H,MM)~LLV(L,MM)!
請協助,謝謝!
是的!
我試過,無法通過編譯!這個公式的程度超出我的能力,因為我也無法判斷能否如此的更改以達到我要的效果,所以想請總版主協助!
感謝!
引用:
最初由 Markchu7 發表
是的!
我試過,無法通過編譯!這個公式的程度超出我的能力,因為我也無法判斷能否如此的更改以達到我要的效果,所以想請總版主協助!
感謝!
1.當沖這個指標名稱是我個人自己對交易時間的自行劃分,為每日的交易起點!
2.原公式是統計過去某幾(請問是畫面可見範圍嗎?)根K棒的成交量,而我是要統計MM根K棒的成交量!當SP小於畫面可見範圍的K棒數時,取SP做統計!當SP大於畫面可見範圍的K棒數時,取畫面可見範圍的K棒數做統計!
3.原公式的橫條圖的範圍為SYSPARAM(4)-SYSPARAM(5)並劃分為十等分,我的橫條圖的範圍為HHV(H,MM)-LLV(L,MM)並劃分為十等分!
請協助!謝謝!
引用:
最初由 Markchu7 發表
1.當沖這個指標名稱是我個人自己對交易時間的自行劃分,為每日的交易起點!
2.原公式是統計過去1200(預設)根K棒的成交量,而我是要統計MM根K棒的成交量!
3.原公式的橫條圖的範圍為SYSPARAM(4)-SYSPARAM(5)並劃分為十等分,我的橫條圖的範圍為HHV(H,MM)-LLV(L,MM)並劃分為十等分!
請協助!謝謝!
不需要一個交易時段,就只統計'畫面可見範圍內的K棒數'!
只是當交易時段開始以後的K棒數(SP),不足於'畫面可見範圍內的K棒數',則統計'交易時段開始以後的K棒數(SP)'!
感謝協助!
引用:
最初由 Markchu7 發表
不需要一個交易時段,就只統計'畫面可見範圍內的K棒數'!
只是當交易時段開始以後的K棒數(SP),不足於'畫面可見範圍內的K棒數',則統計'交易時段開始以後的K棒數(SP)'!
感謝協助!
原碼:
N:=10; CC:=C; VV:=V; KL:=SYSPARAM(2); KR:=SYSPARAM(3); 當沖:=(DATATYPE<>12 AND ISREGULARFBAR) or TRADEDATE<>REF(TRADEDATE,1) or BARPOS=1 OR (DATATYPE=12 AND TIME=084520); for i=datacount downto lbound(當沖) do begin if 當沖[i] and i>KL then begin KL:=i; break; end; end; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,KZ+1);PH:=PH[KR]; PL:=LLV(L,KZ+1);PL:=PL[KR]; 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; FILLRGN(ML[01]>=KN/KZ and KN>0,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and KN>0,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and KN>0,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and KN>0,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and KN>0,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and KN>0,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and KN>0,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and KN>0,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and KN>0,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and KN>0,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;
感謝總版主協助!
總版主,先說聲對不起!
因為當前一根K棒未收盤確定時,橫條圖總會時時跳動,對看盤影響甚大!
能否調整為橫條圖統計與繪圖僅止於倒數第二根K棒,讓畫面不至於時時跳動!
思慮不周,再次請求,甚感不安,請總版主協助!
公式超出能力所及!試過'REF(ML[01]>=KN/KZ and KN>0,1)=1'如此處理!當然是不行!
引用:
最初由 Markchu7 發表
總版主,先說聲對不起!
因為當前一根K棒未收盤確定時,橫條圖總會時時跳動,對看盤影響甚大!
能否調整為橫條圖統計與繪圖僅止於倒數第二根K棒,讓畫面不至於時時跳動!
思慮不周,再次請求,甚感不安,請總版主協助!
公式超出能力所及!試過'REF(ML[01]>=KN/KZ and KN>0,1)=1'如此處理!當然是不行!:D
太感謝了!祝大家都平安喜樂!
再次請教總版主:如果只要畫前三大量的橫條圖的條件公式的寫法!感恩!
引用:
最初由 Markchu7 發表
再次請教總版主:如果只要畫前三大量的橫條圖的條件公式的寫法!感恩!
原碼:
N:=10; CC:=C; VV:=V; KL:=SYSPARAM(2); KR:=SYSPARAM(3)-(SYSPARAM(3)=datacount); 當沖:=(DATATYPE<>12 AND ISREGULARFBAR) or TRADEDATE<>REF(TRADEDATE,1) or BARPOS=1 OR (DATATYPE=12 AND TIME=084520); for i=datacount downto lbound(當沖) do begin if 當沖[i] and i>KL then begin KL:=i; break; end; end; KN:=barpos-KL; KZ:=KR-KL; PH:=HHV(H,KZ+1);PH:=PH[KR]; PL:=LLV(L,KZ+1);PL:=PL[KR]; PS:=(PH-PL)/10; VARIABLE:MH[N]=0,MZ[N]=0,ML[N]=0,MP[N]=0,MPS[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; MPS[i]:=MP[i]; end; x:=sortpos(MPS,1,1,N); for i=4 to N do ML[MPS[i]]:=0; FILLRGN(ML[01]>=KN/KZ and KN>0,MH[01],MH[01]-PS) color555555; FILLRGN(ML[02]>=KN/KZ and KN>0,MH[02],MH[02]-PS) color888888; FILLRGN(ML[03]>=KN/KZ and KN>0,MH[03],MH[03]-PS) color555555; FILLRGN(ML[04]>=KN/KZ and KN>0,MH[04],MH[04]-PS) color888888; FILLRGN(ML[05]>=KN/KZ and KN>0,MH[05],MH[05]-PS) color555555; FILLRGN(ML[06]>=KN/KZ and KN>0,MH[06],MH[06]-PS) color888888; FILLRGN(ML[07]>=KN/KZ and KN>0,MH[07],MH[07]-PS) color555555; FILLRGN(ML[08]>=KN/KZ and KN>0,MH[08],MH[08]-PS) color888888; FILLRGN(ML[09]>=KN/KZ and KN>0,MH[09],MH[09]-PS) color555555; FILLRGN(ML[10]>=KN/KZ and KN>0,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;
非常感謝!
全部時間均為台灣時間, 現在時間為01:53 | 總頁數 (3): [1] 2 3 » 在這個頁面顯示本主題全部的 41 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.