三線反轉(zhuǎn)源碼
三線反轉(zhuǎn),又稱三價(jià)線,是股票K線戰(zhàn)法一書中記錄的,日本證券界常用的股票價(jià)格線圖。該圖的繪制中,僅考慮股票的價(jià)格,而不考慮時(shí)間,故無(wú)法與常用的陰陽(yáng)線同圖顯示。本源碼對(duì)此進(jìn)行改進(jìn),根據(jù)三線反轉(zhuǎn)圖中黑白塊對(duì)應(yīng)的時(shí)間,對(duì)其寬度進(jìn)行調(diào)整,使三線反轉(zhuǎn)圖可以與標(biāo)準(zhǔn)的陰陽(yáng)線圖對(duì)應(yīng)顯示。源碼如下,適用于飛狐交易師軟件:VARIABLE: fc:=close,fh:=h,fl:=l,fcolor:=0,ft1:=0,fb1:=0,fi:=0,t4=0,b4=0,pt=1,pb=1;if datacount<2 then exit;for i=1 to 4 do begin ti:=i;bi:=1; end;for i=2 to datacount do begin if fci>fctpt then begin fhi:=fci;fli:=fct1;fcolori:=1; b4:=b3;b3:=b2;b2:=b1;b1:=t1; t4:=t3;t3:=t2;t2:=t1;t1:=i; pt:=1; pb:=if(pb=3,3,pb+1); end; else if fci<fcbpb then begin fhi:=fcb1;fli:=fci;fcolori:=-1; t4:=t3;t3:=t2;t2:=t1;t1:=b1; b4:=b3;b3:=b2;b2:=b1;b1:=i; pb:=1; pt:=if(pt=3,3,pt+1); end; else if fci<=fctpt and fci>=fcbpb then begin fhi:=fhi-1;fli:=fli-1; fcolori:=fcolori-1; end; ft1i:=t1;fb1i:=b1;fii:=i;end;STICKLINE(fcolor=1,fh,fl,10,0) colorred;STICKLINE(fcolor=-1,fh,fl,10,0) colorgreen;