![]() |
在這個頁面顯示本主題全部的 7 個文章 |
奇狐社區論壇 (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=24341)
鱷魚戰神
版主你好 求助
這是在小時區畫上大時區K 線
是否可以幫我 在ˊ60 分k上修改成 5根及14根 這樣 就可以在60分k 上呈現台指 日夜盤在ˊ60 分k上 ㄝ並且下午盤及早盤開始時 開始計算k棒 謝ˋ謝 我不會修改需飯粒才求助
//=======================鱷魚戰神 0904-6A===========================================================================
IF DATATYPE <7 THEN BEGIN
Var1:=(H+L)/2;
上唇:=REF(SMA(Var1,5,1),3),COLORGREEN;
牙齒:=REF(SMA(Var1,8,1),5),COLORRED;
下顎:=REF(SMA(Var1,13,1),8),COLORBLUE;
if datacount<kkN1 then exit;
m1:=mod(barpos,kkN1);m:=if(m1=0,kkN1-1,m1-1);mz:=backset(m=kkN1-1 or islastbar,intpart(m/2)+1);
//vertline(m=0),colorred,pointdot;
//vertline(m=kkN1-1),colorgreen,pointdot;
bx:=barslast(m=0);by:=barslast(m=kkN1-1);
OO:ref(o,bx),linethick0;
Cy:=ref(C*(by=0),barslast(C*(by=0)));hhx:=hhv(h,bx+1)*(by=0);llx:=llv(if(L=0,100000,L),bx+1)*(by=0);
cab:=IF(bx=0,CLOSE,0);cba:=IF(by=0,CLOSE,0);CC1:=c*0;cba1:=IF(by=0,HHX,0);HH1:=c*0;cba2:=IF(by=0,LLX,0);LL1:=c*0;
for n=lbound(cab) to ubound(cab) do begin
if cab[n]>0 then begin
for z=n+kkN1-1 to ubound(cab) do begin
if cba[z]>0 then begin
for s=n to z-1 do begin
CC1[s]:=cba[z];
HH1[s]:=cba1[z];
LL1[s]:=cba2[z];
end;
break;
end;
end;
end;
end;
c1:=C;h3:=hhv(h,m[datacount]+1);L3:=LLV(if(L=0,1000000,L),m[datacount]+1);
CC:if(barpos>datacount-m[datacount]-1,c1[datacount],if(m=kkN1-1,C,CC1)),linethick0;
HH:if(barpos>datacount-m[datacount]-1,h3[datacount],if(m=kkN1-1,ref(HH1,1),HH1)),linethick0;
LL:if(barpos>datacount-m[datacount]-1,L3[datacount],if(m=kkN1-1,ref(LL1,1),LL1)),linethick0;
partline(m>0 and CC>=OO,CC),color000FF LINETHICK6;
partline(m>0 and CC<OO,CC) ,colorFFFF00 LINETHICK6;
partline(m>0 and CC>=OO,OO),color0000FF LINETHICK6;
partline(m>0 and CC<OO,OO) ,colorFFFF00 LINETHICK6;
stickline((m=kkN1-1 or islastbar) and CC>=OO,OO,CC,1,0),color0000FF LINETHICK3;
stickline((m=kkN1-1 or islastbar) and CC<OO,OO,CC,1,0) ,colorFFFF00 LINETHICK3;
stickline(m=0 and CC>=OO,OO,CC,1,0),color0000FF LINETHICK3;
stickline(m=0 and CC<OO,OO,CC,1,0) ,colorFFFF00 LINETHICK3;
stickline(mz=1 and ref(mz=1,1)=0 and CC>=OO,HH,CC,1,0),color0000FF LINETHICK3;
stickline(mz=1 and ref(mz=1,1)=0 and CC<OO,HH,OO,1,0) ,colorFFFF00 LINETHICK3;
stickline(mz=1 and ref(mz=1,1)=0 and CC>=OO,OO,LL,1,0),coloR0000FF LINETHICK3;
stickline(mz=1 and ref(mz=1,1)=0 and CC<OO,CC,LL,1,0), colorFFFF00 LINETHICK3;
//END;
//=================================================================
回覆: 鱷魚戰神
引用:
最初由 ivancclai 發表
版主你好 求助
這是在小時區畫上大時區K 線
是否可以幫我 在ˊ60 分k上修改成 5根及14根 這樣 就可以在60分k 上呈現台指 日夜盤在ˊ60 分k上 ㄝ並且下午盤及早盤開始時 開始計算k棒 謝ˋ謝 我不會修改需飯粒才求助
............(略)...........
畫日夜盤各自的大K
StCK:=IsRegularFBar or Tradedate<>ref(Tradedate,1);
EdCK:=refx(StCK,1) or islastbar;
StSP:=barslast(StCK);
MO:=ref(O,StSP); MC:=C;
MH:=HHV(H,StSP+1);
ML:=LLV(L,StSP+1);
MH:=SETVAL(EdCK,MH,-StSP,MH);
ML:=SETVAL(EdCK,ML,-StSP,ML);
MC:=SETVAL(EdCK,MC,-StSP,MC);
DW:=SETVAL(EdCK,EdCK,-StSP,EdCK) and StSP>0;
MK:=barpos-FLOOR((StSP/2));
MK:=SETVAL(EdCK,MK,-StSP,MK);
KT:=((MC>MO)+1)*(StCK+EdCK<2);
STICKLINE(StCK and KT=2,MC,MO,0.1,0) linedot colorred;
STICKLINE(EdCK and KT=2,MC,MO,0.1,0) linedot colorred;
PARTLINE(DW and KT=2,MO) linedot colorred;
PARTLINE(DW and KT=2,MC) linedot colorred;
STICKLINE(barpos=MK and KT=2,MH,MAX(MC,MO),0.1,0) linedot colorred;
STICKLINE(barpos=MK and KT=2,ML,MIN(MC,MO),0.1,0) linedot colorred;
STICKLINE(StCK and KT=1,MC,MO,0.1,0) linedot colorgreen;
STICKLINE(EdCK and KT=1,MC,MO,0.1,0) linedot colorgreen;
PARTLINE(DW and KT=1,MO) linedot colorgreen;
PARTLINE(DW and KT=1,MC) linedot colorgreen;
STICKLINE(barpos=MK and KT=1,MH,MAX(MC,MO),0.1,0) linedot colorgreen;
STICKLINE(barpos=MK and KT=1,ML,MIN(MC,MO),0.1,0) linedot colorgreen;
謝謝版主 ˊ60 分K 上顯示正常了 是我需要的
版主你好
我如何以早盤及夜盤對齊 為第一根開始畫
線 類似 1分k畫15分k, 5分k畫ˊˊ60分k 15分k 畫60分k 但要對齊 早盤及夜盤第一根 這部分下列程式錯誤 我不會對齊 我不曉得如何修正 謝謝 是否請版主教我 謝謝
//======================== 鱷魚戰神 ===========================================================================
IF DATATYPE <5 or datatype >10 THEN BEGIN
if datatype=1 or datatype=12 then begin // 1分K
kkn1:=15;
end;
if datatype=2 then begin // 5分K
kkn1:=12;
end;
if datatype=3 then begin // 15分K
kkn1:=4;
end;
if datacount<kkN1 then exit;
m1:=mod(barpos,kkN1);m:=if(m1=0,kkN1-1,m1-1);mz:=backset(m=kkN1-1 or islastbar,intpart(m/2)+1);
//vertline(m=0),colorred,pointdot;
//vertline(m=kkN1-1),colorgreen,pointdot;
bx:=barslast(m=0);by:=barslast(m=kkN1-1);
OO:ref(o,bx),linethick0;
Cy:=ref(C*(by=0),barslast(C*(by=0)));hhx:=hhv(h,bx+1)*(by=0);llx:=llv(if(L=0,100000,L),bx+1)*(by=0);
cab:=IF(bx=0,CLOSE,0);cba:=IF(by=0,CLOSE,0);CC1:=c*0;cba1:=IF(by=0,HHX,0);HH1:=c*0;cba2:=IF(by=0,LLX,0);LL1:=c*0;
for n=lbound(cab) to ubound(cab) do begin
if cab[n]>0 then begin
for z=n+kkN1-1 to ubound(cab) do begin
if cba[z]>0 then begin
for s=n to z-1 do begin
CC1[s]:=cba[z];
HH1[s]:=cba1[z];
LL1[s]:=cba2[z];
end;
break;
end;
end;
end;
end;
c1:=C;h3:=hhv(h,m[datacount]+1);L3:=LLV(if(L=0,1000000,L),m[datacount]+1);
CC:if(barpos>datacount-m[datacount]-1,c1[datacount],if(m=kkN1-1,C,CC1)),linethick0;
HH:if(barpos>datacount-m[datacount]-1,h3[datacount],if(m=kkN1-1,ref(HH1,1),HH1)),linethick0;
LL:if(barpos>datacount-m[datacount]-1,L3[datacount],if(m=kkN1-1,ref(LL1,1),LL1)),linethick0;
partline(m>0 and CC>=OO,CC),color000FF LINETHICK6;
partline(m>0 and CC<OO,CC) ,colorFFFF00 LINETHICK6;
partline(m>0 and CC>=OO,OO),color0000FF LINETHICK6;
partline(m>0 and CC<OO,OO) ,colorFFFF00 LINETHICK6;
stickline((m=kkN1-1 or islastbar) and CC>=OO,OO,CC,1,0),color0000FF ;
stickline((m=kkN1-1 or islastbar) and CC<OO,OO,CC,1,0) ,colorFFFF00 ;
stickline(m=0 and CC>=OO,OO,CC,1,0),color0000FF ;
stickline(m=0 and CC<OO,OO,CC,1,0) ,colorFFFF00 ;
stickline(mz=1 and ref(mz=1,1)=0 and CC>=OO,HH,CC,1,0),color0000FF ;
stickline(mz=1 and ref(mz=1,1)=0 and CC<OO,HH,OO,1,0) ,colorFFFF00 ;
stickline(mz=1 and ref(mz=1,1)=0 and CC>=OO,OO,LL,1,0),coloR0000FF ;
stickline(mz=1 and ref(mz=1,1)=0 and CC<OO,CC,LL,1,0), colorFFFF00 ;
//END;
//=================================================================
引用:
最初由 ivancclai 發表
版主你好
我如何以早盤及夜盤對齊 為第一根開始畫
線 類似 1分k畫15分k, 5分k畫ˊˊ60分k 15分k 畫60分k 但要對齊 早盤及夜盤第一根 這部分下列程式錯誤 我不會對齊 我不曉得如何修正 謝謝 是否請版主教我 謝謝
.........略.........
原碼:
//繪製分線大K,以日盤和夜盤為起算點,可應用在任意分線 N:=15; //設定大K分鐘數(N值必須要能被當前週期分鐘數整除) KTSP:=0; if datatype>=1 and datatype<=5 then KTSP:=STRTONUM(STRMID('0105153060',DATATYPE*2-1,2)); if datatype=11 then KTSP:=datatypem; if KTSP>N or mod(N,KTSP)>0 then KTSP:=0; DRAWTEXTEX(KTSP=0,1,500,450,'錯誤! 大K分鐘數設定不當(無法整除) 或 目前週期不適用') ALIGN0 colorred; if KTSP=0 then exit; StCK:=IsRegularFBar or Tradedate<>ref(Tradedate,1) or ref(mod(openminutes,n)=0,1); EdCK:=refx(StCK,1) or islastbar; StSP:=barslast(StCK); MO:=ref(O,StSP); MC:=C; MH:=HHV(H,StSP+1); ML:=LLV(L,StSP+1); MH:=SETVAL(EdCK,MH,-StSP,MH); ML:=SETVAL(EdCK,ML,-StSP,ML); MC:=SETVAL(EdCK,MC,-StSP,MC); DW:=SETVAL(EdCK,EdCK,-StSP,EdCK) and StSP>0; MK:=barpos-FLOOR((StSP/2)); MK:=SETVAL(EdCK,MK,-StSP,MK); KT:=((MC>MO)+1)*(StCK+EdCK<2); STICKLINE(StCK and KT=2,MC,MO,0.1,0) linedot colorred; STICKLINE(EdCK and KT=2,MC,MO,0.1,0) linedot colorred; PARTLINE(DW and KT=2,MO) linedot colorred; PARTLINE(DW and KT=2,MC) linedot colorred; STICKLINE(barpos=MK and KT=2,MH,MAX(MC,MO),0.1,0) linedot colorred; STICKLINE(barpos=MK and KT=2,ML,MIN(MC,MO),0.1,0) linedot colorred; STICKLINE(StCK and KT=1,MC,MO,0.1,0) linedot colorgreen; STICKLINE(EdCK and KT=1,MC,MO,0.1,0) linedot colorgreen; PARTLINE(DW and KT=1,MO) linedot colorgreen; PARTLINE(DW and KT=1,MC) linedot colorgreen; STICKLINE(barpos=MK and KT=1,MH,MAX(MC,MO),0.1,0) linedot colorgreen; STICKLINE(barpos=MK and KT=1,ML,MIN(MC,MO),0.1,0) linedot colorgreen; VERTLINE(IsRegularFBar or Tradedate<>ref(Tradedate,1))
謝謝版主 解決我問題
全部時間均為台灣時間, 現在時間為19:51 | 在這個頁面顯示本主題全部的 7 個文章 |
Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.
簡愛洋行 製作 Copyright 2003-. All Rights Reserved.