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

奇狐社區論壇 (http://www.chiefox.com.tw/bbs/index.php)
- 應用交流 (http://www.chiefox.com.tw/bbs/forumdisplay.php?forumid=33)
-- 劃向上下趨勢線(5分鐘圖用) (http://www.chiefox.com.tw/bbs/showthread.php?threadid=10871)


由 mowtua 在 2008-12-27 18:23 發表:

劃向上下趨勢線(5分鐘圖用)

INPUT:N(200,0,999);
hh:=hhv(h,N);
hhh:=h;
aa:=BARSLAST(h=hh[datacount]);
ba:datacount-aa,LINETHICK0;
ja:=1;
tm1:=999999;
for i1=ba[datacount]+1 to datacount do begin k1:=(hh[datacount]-hhh[i1])/ja;
if k1<tm1 then begin tm1:=k1;
ts1:=ja;
end;
ja:=ja+1;
end;
A1:LINEVALUE(h=hh[datacount] and aa=0,h,BARPOS=datacount-aa[datacount]+ts1,h,0,0),colorffff54;
cha:=hhv(abs(l-a1),aa);
A2:a1-cha[datacount],colorffff54;
AI:a1-cha[datacount]/2,colorffff54,LINEDASH;

ll:=llv(l,N);
lll:=l;
a3:=BARSLAST(l=ll[datacount]);
b3:=datacount-a3;
j3:=1;
tm3:=999999;
for i3=b3[datacount]+1 to datacount do begin k3:=(lll[i3]-ll[datacount])/j3;
if k3<tm3 then begin tm3:=k3;
ts3:=j3;
end;
j3:=j3+1;
end;
B1:LINEVALUE(l=ll[datacount] and a3=0,l,BARPOS=datacount-a3[datacount]+ts3,l,0,0),color5454ff;
chb:=hhv(abs(h-b1),a3);
b2:b1+chb[datacount],color5454ff;
bi:b1+chb[datacount]/2,color5454ff,LINEDASH;


AAA:HHV(MA(H,3),10),COLORMAGENTA,linethick1;
BBB:LLV(MA(L,3),10),COLORMAGENTA,linethick1;


FZ:=PEAK(3,5,1);
FW:=PEAKBARS(3,5,1);
GZ:=TROUGH(3,5,1);
GW:=TROUGHBARS(3,5,1);
DRAWLINE(FW=0,FZ,GW=0 or ISLASTBAR,REF(FZ,FW),0),Color02A800;
DRAWLINE(GW=0,GZ,FW=0 or ISLASTBAR,REF(GZ,GW),0),COLORMAGENTA;


Var11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
Var12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
Var13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
Var14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
Var15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
Var16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
Var17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
Var18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
BUY:=(Var11+Var13+Var15+Var17);
SELL:=(Var12+Var14+Var16+Var18);
DRAWTEXT(BUY>0,L-0.01,'BUY'),color33FF33;
DRAWTEXT(SELL>0,H+0.1,'SELL'),colorFFFF00;


STICKLINE(O>=C,H,L,0,0),COLORCYAN;
STICKLINE(O>=C,C,O,6,0),COLORCYAN;
STICKLINE(C>=O,L,H,0,0),COLORRED;
STICKLINE(C>=O,C,O,6,1),COLORRED;


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


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

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