一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

數(shù)浪公式+薛斯通道

 周玨 2009-01-05

數(shù)浪公式+薛斯通道


N=5

v1:=ma(HIGH,30)*1.15 ;
v2:=ma(HIGH,3)*1.03;
v3:=ma(LOW,3)*0.97;
v4:=ma(LOW,30)*0.85;
{v5}大通道上:fft(v1,30);
{v6}小通道上:fft(v2,30);
{v7}小通道下:fft(v3,30);
{v8}大通道下:fft(v4,30);
A1:=大通道上-REF(大通道上,1);
A2:=小通道上-REF(小通道上,1);
A3:=小通道下-REF(小通道下,1);
A4:=大通道下-REF(大通道下,1);
PARTLINE(A1>0,大通道上) LINETHICK2 COLORRED;
PARTLINE(A1=0,大通道上) LINETHICK1 COLORWHITE;
PARTLINE(A1<0,大通道上) LINETHICK1 COLORGREEN;
PARTLINE(A2>0,小通道上) LINETHICK2 COLORRED;
PARTLINE(A2=0,小通道上) LINETHICK1 COLORWHITE;
PARTLINE(A2<0,小通道上) LINETHICK1 COLORGREEN;
PARTLINE(A3>0,小通道下) LINETHICK2 COLORRED;
PARTLINE(A3=0,小通道下) LINETHICK1 COLORWHITE;
PARTLINE(A3<0,小通道下) LINETHICK1 COLORGREEN;
PARTLINE(A4>0,大通道下) LINETHICK2 COLORRED;
PARTLINE(A4=0,大通道下) LINETHICK1 COLORWHITE;
PARTLINE(A4<0,大通道下) LINETHICK1 COLORGREEN;

kxs:=sysparam(2);
dsj:=1;
GET:zig(3,n),coloryellow;
pl5:=zig(3,5)*dsj;
en1:=zig(3,5)>ref(zig(3,5),1) and ref(zig(3,5),1)<=ref(zig(3,5),2) and  ref(zig(3,5),2)<=ref(zig(3,5),3)*dsj;
ex1:=zig(3,5)<ref(zig(3,5),1) and ref(zig(3,5),1)>=ref(zig(3,5),2) and  ref(zig(3,5),2)>=ref(zig(3,5),3)*dsj;
pl10:=zig(3,10)*dsj;
en2:=zig(3,10)>ref(zig(3,10),1) and ref(zig(3,10),1)<=ref(zig(3,10),2)  and ref(zig(3,10),2)<=ref(zig(3,10),3)*dsj;
ex2:=zig(3,10)<ref(zig(3,10),1) and ref(zig(3,10),1)>=ref(zig(3,10),2)  and ref(zig(3,10),2)>=ref(zig(3,10),3)*dsj;
pl20:=zig(3,20)*dsj;
en3:=zig(3,20)>ref(zig(3,20),1) and ref(zig(3,20),1)<=ref(zig(3,20),2)  and ref(zig(3,20),2)<=ref(zig(3,20),3)*dsj;
ex3:=zig(3,20)<ref(zig(3,20),1) and ref(zig(3,20),1)>=ref(zig(3,20),2)  and ref(zig(3,20),2)>=ref(zig(3,20),3)*dsj;
pl40:=zig(3,40)*dsj;
走強(qiáng)1:=barslast(pl5<ref(pl5,1));
走弱1:=barslast(pl5>ref(pl5,1));
走強(qiáng)2:=barslast(pl10<ref(pl10,1));
走弱2:=barslast(pl10>ref(pl10,1));
走強(qiáng)3:=barslast(pl20<ref(pl20,1));
走弱3:=barslast(pl20>ref(pl20,1));
ztjz5:=if(pl10>ref(pl10,1),count(en1,走強(qiáng)2),0);
ztjd5:=if(pl10>ref(pl10,1),count(ex1,走強(qiáng)2),0);
dtjz5:=if(pl10<ref(pl10,1),count(en1,走弱2),0);
dtjd5:=if(pl10<ref(pl10,1),count(ex1,走弱2),0);
ztjz10:=if(pl20>ref(pl20,1),count(en2,走強(qiáng)3),0);
ztjd10:=if(pl20>ref(pl20,1),count(ex2,走強(qiáng)3),0);
dtjz10:=if(pl20<ref(pl20,1),count(en2,走弱3),0);
dtjd10:=if(pl20<ref(pl20,1),count(ex2,走弱3),0);
drawtext(en1 and dtjz5=1,l*0.98,'㈠'),colorffff00;
drawtext(ex1 and dtjd5=2,h*1.02,'㈡'),colorffff00;
drawtext(en2 and ztjz5=1,l*0.98,'㈢'),colorffff00;
drawtext(ex1 and pl10>ref(pl10,1) and ztjd5=1,h*1.02,'⑴'),colorff;
drawtext(en1 and pl10>ref(pl10,1) and ztjz5=2,l*0.98,'⑵'),colorff;
drawtext(ex1 and pl10>ref(pl10,1) and ztjz5=2,h*1.02,'⑶'),colorff;
drawtext(en1 and pl10>ref(pl10,1) and ztjz5=3,l*0.98,'⑷'),colorff;
drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=1,h*1.02,'⑸'),colorff;
drawtext(en2 and dtjz10=1,l*0.94,'Ⅰ'),colorff0000;
drawtext(ex2 and dtjd10=2,h*1.06,'Ⅱ'),colorff0000;
drawtext(en3 and ztjz10=1,l*0.94,'Ⅲ'),colorff0000;
drawtext(ex2 and pl20>ref(pl20,1) and  ztjd10=1,h*1.06,'①'),Linethick3,colorffff;
drawtext(en2 and pl20>ref(pl20,1) and  ztjz10=2,l*0.94,'②'),Linethick3,colorffff;
drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=2 or (ztjd10=0 or  ztjd10=2) and ex2,h*1.06*dsj,'③'),Linethick3,colorffff;
drawtext(en2 and pl20>ref(pl20,1) and  ztjz10=3,l*0.94,'④'),Linethick3,colorffff;
 

點(diǎn)石成金


畫(huà)漸變背景色((收盤(pán)價(jià) > 0),RGB顏色值(0,0,0),RGB顏色值(0,0,0),0);
input: N(5,1,60);
DRAWGBK(C, COLORRGB(10,40,10),COLORRGB(10,40,10),1);
{-----------------------☆功能開(kāi)關(guān)------------------------}
jQCB:=EMA(C,3);
h1:=h;
hh:=hhv(h,21);
L1:=L;
LL:=llv(L,21);
if   h1[datacount] =hh[datacount]  then  begin
if   L1[datacount] =LL[datacount]  then  begin
end;  
end;
頂:=hh,LINEDOT,PRECISION2,COLORYELLOW;//黃
底:=LL,LINEDOT,PRECISION2,COLORGREEN;//綠
DScj1:=PEAKBARS(3,N,1);
DScj2:=TROUGHBARS(3,N,1);
DScj3:=PEAKBARS(2,N,1);
點(diǎn)石:=ma(LLV(jQCB,3),DScj2+1),PRECISION2,LINETHICK,ColorFFA6FF;
成金:=ma(HHV(jQCB,1),DScj3+1),PRECISION2,LINETHICK,COLORYELLOW;
壓力:=ma(wma(h,2),DScj1+1),PRECISION2,LINETHICK,ColorFF8700;
Kn:=BARSCOUNT(C)=SYSPARAM(1);                p:=SYSPARAM(1);
{未來(lái)參考K線}
F:=100*(C-REF(C,1))/REF(C,1);
p1:=IF(C<REF(O,1) AND f<0,1,0);
p3:=IF(C>REF(O,1) AND f>0,1,0);
p2:=IF(C<REF(O,2) AND f<0,1,0);
p4:=IF(C>REF(O,2) AND f>0,1,0);
買(mǎi)D5:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1;
賣(mài)D6:=P3=0 AND REF(P3,1)=1 AND P4=0 AND REF(P4,1)=1;
AS:=ZIG(3,3);  
漲AL:=CROSS(AS,REF(AS,1));
跌AG:=CROSS(REF(AS,1),AS);
買(mǎi)點(diǎn):=FILTER((TROUGHBARS(3,15,1)<4)=1,3);//提前一天
賣(mài)點(diǎn):=FILTER((PEAKBARS(3,15,1)<4)=1,3);  //提前一天
{-----------------【圖解模板】---------------------}
{K線}
KLINE(O,H,L,C,0);
{未來(lái)K線}
STICKLINE(買(mǎi)點(diǎn),L,(O+C)/2,0,0),COLORWHITE; {未來(lái)買(mǎi)點(diǎn)}
STICKLINE(買(mǎi)點(diǎn),C,(O+C)/2,7,0),COLORWHITE; {未來(lái)買(mǎi)點(diǎn)}
STICKLINE(賣(mài)點(diǎn),H,(O+C)/2,0,0),COLORYELLOW;{未來(lái)賣(mài)點(diǎn)}
STICKLINE(賣(mài)點(diǎn),C,(O+C)/2,7,0),COLORYELLOW;{未來(lái)賣(mài)點(diǎn)}
STICKLINE(買(mǎi)D5 and 漲AL,L,(O+C)/2,0,0),COLORWHITE; {未來(lái)買(mǎi)}
STICKLINE(買(mǎi)D5 and 漲AL,O,(O+C)/2,7,0),COLORWHITE; {未來(lái)買(mǎi)}
STICKLINE(賣(mài)D6 and 跌AG,L,(O+C)/2,0,0),Color3EA63E;{未來(lái)賣(mài)}
STICKLINE(賣(mài)D6 and 跌AG,O,(O+C)/2,7,0),Color3EA63E;{未來(lái)賣(mài)}
{}
PARTLINE(C,頂),LINEDOT,COLORYELLOW;//黃
PARTLINE(C,底),LINEDOT,COLORGREEN;//綠
{}
PARTLINE(DScj1>0,壓力),ColorFFB900; //壓力--暗藍(lán)
PARTLINE(DScj2>0,點(diǎn)石),ColorFFA6FF; //點(diǎn)石--暗粉
PARTLINE(DScj3>0 and 成金>ref(成金,1),成金),LINETHICK2,Color00A3C1;//成金--金黃
{}
DRAWTEXT(Kn AND DScj2>0,點(diǎn)石*0.98,'點(diǎn)石:'+NUMTOSTR(點(diǎn)石[p],2)),ALIGN0,ColorFFA6FF;
DRAWTEXT(Kn AND DScj3>0 and 成金>ref(成金,1),成金,'成金:'+NUMTOSTR(成金[p],2)),ALIGN0,PXDN12,COLORYELLOW;
DRAWTEXT(Kn AND DScj1>0,壓力,'壓力:'+NUMTOSTR(壓力[p],2)),ALIGN2,PXUP12,ColorFF8700;
//

新結(jié)構(gòu)波浪


新結(jié)構(gòu)波浪


A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高點(diǎn)}
A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低點(diǎn)}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低點(diǎn)出現(xiàn)在同一K線上時(shí)可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{過(guò)濾后低點(diǎn)}
L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{過(guò)濾后高點(diǎn)}
DRAWLINE(LD,L,HD,H,0),COLORWHITE,LINETHICK1,POINTDOT;
DRAWLINE(HD,H,LD,L,0),COLORWHITE,LINETHICK1,POINTDOT;
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
{以上語(yǔ)句為新結(jié)構(gòu)波浪}

A3:=H<REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HH:=E3>REF(E3,1);{找出全部長(zhǎng)期高點(diǎn)}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)<REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部長(zhǎng)期低點(diǎn)}
DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1;
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面進(jìn)行過(guò)濾,方法同前。只是不用考慮高低點(diǎn)出現(xiàn)在同一K線}
X3:=REF(BARSLAST(H3),1)+1; F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);  I3:=BACKSET(G3,2);  LZ:=I3>REF(I3,1),LINETHICK0; {長(zhǎng)期低點(diǎn),也可供引用}
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1; F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);  I4:=BACKSET(G4,2);  HZ:=I4>REF(I4,1),LINETHICK0;{長(zhǎng)期高點(diǎn),也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{長(zhǎng)期連線}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),ISLASTBAR,C,0),COLORGREEN,LINETHICK1; {最后的長(zhǎng)期連線,連在收盤(pán)價(jià)上}

{以下是兩條趨勢(shì)線原碼}
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;

前一低:REF(L,BARSLAST(VV)),COLOR99FF66,POINTDOT,LINETHICK3;
前二低:REF(L,BARSLAST(XX)),COLORFF66FF,POINTDOT,LINETHICK3;
前一高:REF(H,BARSLAST(VV2)),COLOR99FF66,POINTDOT,LINETHICK3;
前二高:REF(H,BARSLAST(XX2)),COLORFF66FF,POINTDOT,LINETHICK3;
短高:=REF(H,BARSLAST(VV2)),LINETHICK0;
短低:=REF(L,BARSLAST(VV)),LINETHICK0;
短比: (C-短低)/(短高-短低),LINETHICK0;

{以下語(yǔ)句是大盤(pán)趨勢(shì)疊加}
常數(shù):=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV));
疊1:INDEXC/常數(shù),COLORGRAY,LINETHICK0;
PARTLINE(1,疊1),COLORGRAY;
常數(shù)2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX));
疊2:INDEXC/常數(shù)2,COLORGRAY,LINETHICK0;
PARTLINE(1,疊2),COLORGRAY;

DRAWNUMBER(HD,1.02*H,DATEDIFF(REF(DATE,BARSLAST(LD)),DATE),0),COLORCYAN;
DRAWNUMBER(LD,0.98*L,DATEDIFF(REF(DATE,BARSLAST(HD)),DATE),0),COLORCYAN;

DRAWNUMBER(HD,H*(1+0.002),H,2),COLORBLUE,ALIGN0;
DRAWNUMBER(LD,L*(1.001-0.002),L,2),COLORBLUE,ALIGN0;
 
 

數(shù)浪公式+薛斯通道


v1:=簡(jiǎn)單移動(dòng)平均(最高價(jià),30)*1.15 ;
v2:=簡(jiǎn)單移動(dòng)平均(最高價(jià),3)*1.03;
v3:=簡(jiǎn)單移動(dòng)平均(最低價(jià),3)*0.97;
v4:=簡(jiǎn)單移動(dòng)平均(最低價(jià),30)*0.85;
{v5}大通道上:傅立葉變換(v1,30);
{v6}小通道上:傅立葉變換(v2,30);
{v7}小通道下:傅立葉變換(v3,30);
{v8}大通道下:傅立葉變換(v4,30);
A1:=大通道上-向前引用(大通道上,1);
A2:=小通道上-向前引用(小通道上,1);
A3:=小通道下-向前引用(小通道下,1);
A4:=大通道下-向前引用(大通道下,1);
畫(huà)分段線(A1>0,大通道上) LINETHICK2 COLORRED;
畫(huà)分段線(A1=0,大通道上) LINETHICK1 COLORWHITE;
畫(huà)分段線(A1<0,大通道上) LINETHICK1 COLORGREEN;
畫(huà)分段線(A2>0,小通道上) LINETHICK2 COLORRED;
畫(huà)分段線(A2=0,小通道上) LINETHICK1 COLORWHITE;
畫(huà)分段線(A2<0,小通道上) LINETHICK1 COLORGREEN;
畫(huà)分段線(A3>0,小通道下) LINETHICK2 COLORRED;
畫(huà)分段線(A3=0,小通道下) LINETHICK1 COLORWHITE;
畫(huà)分段線(A3<0,小通道下) LINETHICK1 COLORGREEN;
畫(huà)分段線(A4>0,大通道下) LINETHICK2 COLORRED;
畫(huà)分段線(A4=0,大通道下) LINETHICK1 COLORWHITE;
畫(huà)分段線(A4<0,大通道下) LINETHICK1 COLORGREEN;
kxs:=系統(tǒng)參數(shù)(2);
dsj:=1;
GET:之字轉(zhuǎn)向(3,n),coloryellow;
pl5:=之字轉(zhuǎn)向(3,5)*dsj;
en1:=之字轉(zhuǎn)向(3,5)>向前引用(之字轉(zhuǎn)向(3,5),1) and 向前引用(之字轉(zhuǎn)向(3,5),1)<=向前引用(之字轉(zhuǎn)向(3,5),2) and  向前引用(之字轉(zhuǎn)向(3,5),2)<=向前引用(之字轉(zhuǎn)向(3,5),3)*dsj;
ex1:=之字轉(zhuǎn)向(3,5)<向前引用(之字轉(zhuǎn)向(3,5),1) and 向前引用(之字轉(zhuǎn)向(3,5),1)>=向前引用(之字轉(zhuǎn)向(3,5),2) and  向前引用(之字轉(zhuǎn)向(3,5),2)>=向前引用(之字轉(zhuǎn)向(3,5),3)*dsj;
pl10:=之字轉(zhuǎn)向(3,10)*dsj;
en2:=之字轉(zhuǎn)向(3,10)>向前引用(之字轉(zhuǎn)向(3,10),1) and 向前引用(之字轉(zhuǎn)向(3,10),1)<=向前引用(之字轉(zhuǎn)向(3,10),2)  and 向前引用(之字轉(zhuǎn)向(3,10),2)<=向前引用(之字轉(zhuǎn)向(3,10),3)*dsj;
ex2:=之字轉(zhuǎn)向(3,10)<向前引用(之字轉(zhuǎn)向(3,10),1) and 向前引用(之字轉(zhuǎn)向(3,10),1)>=向前引用(之字轉(zhuǎn)向(3,10),2)  and 向前引用(之字轉(zhuǎn)向(3,10),2)>=向前引用(之字轉(zhuǎn)向(3,10),3)*dsj;
pl20:=之字轉(zhuǎn)向(3,20)*dsj;
en3:=之字轉(zhuǎn)向(3,20)>向前引用(之字轉(zhuǎn)向(3,20),1) and 向前引用(之字轉(zhuǎn)向(3,20),1)<=向前引用(之字轉(zhuǎn)向(3,20),2)  and 向前引用(之字轉(zhuǎn)向(3,20),2)<=向前引用(之字轉(zhuǎn)向(3,20),3)*dsj;
ex3:=之字轉(zhuǎn)向(3,20)<向前引用(之字轉(zhuǎn)向(3,20),1) and 向前引用(之字轉(zhuǎn)向(3,20),1)>=向前引用(之字轉(zhuǎn)向(3,20),2)  and 向前引用(之字轉(zhuǎn)向(3,20),2)>=向前引用(之字轉(zhuǎn)向(3,20),3)*dsj;
pl40:=之字轉(zhuǎn)向(3,40)*dsj;
走強(qiáng)1:=上一次條件成立位置(pl5<向前引用(pl5,1));
走弱1:=上一次條件成立位置(pl5>向前引用(pl5,1));
走強(qiáng)2:=上一次條件成立位置(pl10<向前引用(pl10,1));
走弱2:=上一次條件成立位置(pl10>向前引用(pl10,1));
走強(qiáng)3:=上一次條件成立位置(pl20<向前引用(pl20,1));
走弱3:=上一次條件成立位置(pl20>向前引用(pl20,1));
ztjz5:=條件函數(shù)(pl10>向前引用(pl10,1),統(tǒng)計(jì)總數(shù)(en1,走強(qiáng)2),0);
ztjd5:=條件函數(shù)(pl10>向前引用(pl10,1),統(tǒng)計(jì)總數(shù)(ex1,走強(qiáng)2),0);
dtjz5:=條件函數(shù)(pl10<向前引用(pl10,1),統(tǒng)計(jì)總數(shù)(en1,走弱2),0);
dtjd5:=條件函數(shù)(pl10<向前引用(pl10,1),統(tǒng)計(jì)總數(shù)(ex1,走弱2),0);
ztjz10:=條件函數(shù)(pl20>向前引用(pl20,1),統(tǒng)計(jì)總數(shù)(en2,走強(qiáng)3),0);
ztjd10:=條件函數(shù)(pl20>向前引用(pl20,1),統(tǒng)計(jì)總數(shù)(ex2,走強(qiáng)3),0);
dtjz10:=條件函數(shù)(pl20<向前引用(pl20,1),統(tǒng)計(jì)總數(shù)(en2,走弱3),0);
dtjd10:=條件函數(shù)(pl20<向前引用(pl20,1),統(tǒng)計(jì)總數(shù)(ex2,走弱3),0);
顯示文字(en1 and dtjz5=1,最低價(jià)*0.98,'㈠'),colorffff00;
顯示文字(ex1 and dtjd5=2,最高價(jià)*1.02,'㈡'),colorffff00;
顯示文字(en2 and ztjz5=1,最低價(jià)*0.98,'㈢'),colorffff00;
顯示文字(ex1 and pl10>向前引用(pl10,1) and ztjd5=1,最高價(jià)*1.02,'⑴'),colorff;
顯示文字(en1 and pl10>向前引用(pl10,1) and ztjz5=2,最低價(jià)*0.98,'⑵'),colorff;
顯示文字(ex1 and pl10>向前引用(pl10,1) and ztjz5=2,最高價(jià)*1.02,'⑶'),colorff;
顯示文字(en1 and pl10>向前引用(pl10,1) and ztjz5=3,最低價(jià)*0.98,'⑷'),colorff;
顯示文字(ex2 and pl20>向前引用(pl20,1) and ztjd10=1,最高價(jià)*1.02,'⑸'),colorff;
顯示文字(en2 and dtjz10=1,最低價(jià)*0.94,'Ⅰ'),colorff0000;
顯示文字(ex2 and dtjd10=2,最高價(jià)*1.06,'Ⅱ'),colorff0000;
顯示文字(en3 and ztjz10=1,最低價(jià)*0.94,'Ⅲ'),colorff0000;
顯示文字(ex2 and pl20>向前引用(pl20,1) and  ztjd10=1,最高價(jià)*1.06,'①'),Linethick3,colorffff;
顯示文字(en2 and pl20>向前引用(pl20,1) and  ztjz10=2,最低價(jià)*0.94,'②'),Linethick3,colorffff;
顯示文字(ex2 and pl20>向前引用(pl20,1) and ztjd10=2 or (ztjd10=0 or  ztjd10=2) and ex2,最高價(jià)*1.06*dsj,'③'),Linethick3,colorffff;
顯示文字(en2 and pl20>向前引用(pl20,1) and  ztjz10=3,最低價(jià)*0.94,'④'),Linethick3,colorffff;

STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,9,0),colorFF5B00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,8,0),colorFF6C00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,7,0),colorFF7B00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,6,0),colorFF9C00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,5,0),colorFFBE00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,3.5,0),colorFFCC00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,1.5,0),colorFFFF00;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,9,0),color70084;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,8,0),colorA3;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,7,0),colorB7;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,6,0),colorCD;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,5,0),colorE9;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,3,0),color754E9;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,1.5,0),color76EF3;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,1,0),color77BF3;
STICKLINE((CLOSE > OPEN),OPEN,LOW,1,0),color726CA;
STICKLINE((CLOSE > OPEN),CLOSE,HIGH,1,0),color726CA;
STICKLINE((OPEN > CLOSE),CLOSE,LOW,1,0),colorDE9100;
STICKLINE((OPEN > CLOSE),OPEN,HIGH,1,0),colorDE9100;


n=21
 
 
 
input: N(5,1,100);
A1:=向前引用(最高價(jià),N)=最高值(最高價(jià),2*N+1);
B1:=信號(hào)過(guò)濾(A1,N);
C1:=向前賦值(B1,N+1);
D1:=信號(hào)過(guò)濾(C1,n);{高點(diǎn)}
A2:=向前引用(最低價(jià),N)=最低值(最低價(jià),2*N+1);
B2:=信號(hào)過(guò)濾(A2,N);
C2:=向前賦值(B2,N+1);
D2:=信號(hào)過(guò)濾(C2,N);{低點(diǎn)}
E1:=(向前引用(最低值(最低價(jià),2*N),1)+向前引用(最高值(最高價(jià),2*N),1))/2; E2:=(最高價(jià)+最低價(jià))/2;{高低點(diǎn)出現(xiàn)在同一K線上時(shí)可作取舍}
H1:=(D1 AND 求邏輯非(D2 AND E1>=E2)) OR 數(shù)據(jù)位置狀態(tài)=2 OR 有效值周期數(shù)(收盤(pán)價(jià))=1;
L1:=(D2 AND 求邏輯非(D1 AND E1<E2));  H2:=D1 AND 求邏輯非(D2 AND E1>=E2);
X1:=向前引用(上一次條件成立位置(H1),1)+1; F1:=向前賦值(H1 AND 統(tǒng)計(jì)總數(shù)(L1,X1)>0,上一低點(diǎn)位置
(條件函數(shù)(L1,最低價(jià),10000),X1));
G1:=F1>向前引用(F1,1); I1:=向前賦值(G1,2); LD:=I1>向前引用(I1,1);{過(guò)濾后低點(diǎn)}
L2:=LD OR 數(shù)據(jù)位置狀態(tài)=2 OR 有效值周期數(shù)(收盤(pán)價(jià))=1;
X2:=向前引用(上一次條件成立位置(L2),1)+1; F2:=向前賦值(L2 AND 統(tǒng)計(jì)總數(shù)(H2,X2)>0,上一高點(diǎn)位置
(條件函數(shù)(H2,最高價(jià),0),X2));
G2:=F2>向前引用(F2,1); I2:=向前賦值(G2,2); HD:=I2>向前引用(I2,1);{過(guò)濾后高點(diǎn)}
R1:=向前賦值(數(shù)據(jù)位置狀態(tài)=2,上一次條件成立位置(HD)+1); S1:=R1>向前引用(R1,1); {前一高}
T1:=向前賦值(數(shù)據(jù)位置狀態(tài)=2,上一次條件成立位置(LD)+1); U1:=T1>向前引用(T1,1); {前一低}
R2:=向前賦值(S1,向前引用(上一次條件成立位置(HD),1)+2); S2:=R2>向前引用(R2,1); {前二高}
T2:=向前賦值(U1,向前引用(上一次條件成立位置(LD),1)+2); U2:=T2>向前引用(T2,1); {前二低}
T3:=向前賦值(U2,向前引用(上一次條件成立位置(LD),1)+2); U3:=T3>向前引用(T3,1); {前三低}
T4:=向前賦值(U3,向前引用(上一次條件成立位置(LD),1)+2); U4:=T4>向前引用(T4,1); {前四低}
R3:=向前賦值(S2,向前引用(上一次條件成立位置(HD),1)+2); S3:=R3>向前引用(R3,1); {前三高}
R4:=向前賦值(S3,向前引用(上一次條件成立位置(HD),1)+2); S4:=R4>向前引用(R4,1); {前四高}
短期壓力:畫(huà)直線(S2,最高價(jià),S1,最高價(jià),1),Colorred;
短期支撐:畫(huà)直線(U2,最低價(jià),U1,最低價(jià),1),Colorgreen;
中期壓力:畫(huà)直線(S3,最高價(jià),S2,最高價(jià),1),Coloryellow;
中期支撐:畫(huà)直線(U3,最低價(jià),U2,最低價(jià),0),Colorgreen;   
長(zhǎng)期壓力:畫(huà)直線(S4,最高價(jià),S3,最高價(jià),1),COLORFF00FF;
長(zhǎng)期支撐:畫(huà)直線(U4,最低價(jià),U3,最低價(jià),0),Colorgreen;
畫(huà)圖標(biāo)(S1,最高價(jià)*1.01,10);
畫(huà)圖標(biāo)(S2,最高價(jià)*1.01,10);
畫(huà)圖標(biāo)(S3,最高價(jià)*1.01,10);
畫(huà)圖標(biāo)(S4,最高價(jià)*1.01,10);
畫(huà)圖標(biāo)(U1,最低價(jià)*0.99,9);
畫(huà)圖標(biāo)(U2,最低價(jià)*0.99,9);
畫(huà)圖標(biāo)(U3,最低價(jià)*0.99,9);
畫(huà)圖標(biāo)(U4,最低價(jià)*0.99,9);
畫(huà)柱線(收盤(pán)價(jià)>=開(kāi)盤(pán)價(jià),開(kāi)盤(pán)價(jià),收盤(pán)價(jià),8,0),COLORRED;
畫(huà)柱線(收盤(pán)價(jià)>=開(kāi)盤(pán)價(jià),收盤(pán)價(jià),最高價(jià),0,0),COLORRED;
畫(huà)柱線(收盤(pán)價(jià)>=開(kāi)盤(pán)價(jià),最低價(jià),開(kāi)盤(pán)價(jià),0,0),COLORRED;
畫(huà)柱線(收盤(pán)價(jià)<開(kāi)盤(pán)價(jià),收盤(pán)價(jià),開(kāi)盤(pán)價(jià),8,0),colorFFFF00;
畫(huà)柱線(收盤(pán)價(jià)<開(kāi)盤(pán)價(jià),開(kāi)盤(pán)價(jià),最高價(jià),0,0),colorFFFF00;
畫(huà)柱線(收盤(pán)價(jià)<開(kāi)盤(pán)價(jià),最低價(jià),收盤(pán)價(jià),0,0),colorFFFF00;
J:=(收盤(pán)價(jià)*2+最高價(jià)+最低價(jià))/4;
K:=(指數(shù)平滑移動(dòng)平均(J,13) - 指數(shù)平滑移動(dòng)平均(J,21))*180;
D:=指數(shù)平滑移動(dòng)平均(K,2);
kk:=K-D;
dd:=-1*(K-D);
jj:=交叉函數(shù)(kk,dd);
畫(huà)柱線(jj,開(kāi)盤(pán)價(jià),收盤(pán)價(jià),8,0),COLORyellow;
畫(huà)柱線(jj,開(kāi)盤(pán)價(jià),最高價(jià),0,0),COLORyellow;
畫(huà)柱線(jj,最低價(jià),收盤(pán)價(jià),0,0),COLORyellow;
ss2:=移動(dòng)平均(收盤(pán)價(jià),3,1);
ss6:=移動(dòng)平均(收盤(pán)價(jià),5,1);
dk:=2*(ss2-ss6)*15*4*1.5;
畫(huà)柱線(dk>0 and kk<dd,開(kāi)盤(pán)價(jià),收盤(pán)價(jià),8,0),COLORgreen;
畫(huà)柱線(dk>0 and kk<dd,開(kāi)盤(pán)價(jià),最高價(jià),0,0),COLORgreen;
畫(huà)柱線(dk>0 and kk<dd,最低價(jià),收盤(pán)價(jià),0,0),COLORgreen;
畫(huà)柱線(dk<0 and kk<dd, 開(kāi)盤(pán)價(jià),收盤(pán)價(jià),8,0),colorgray;
畫(huà)柱線(dk<0 and kk<dd ,開(kāi)盤(pán)價(jià),最高價(jià),0,0),colorgray;
畫(huà)柱線(dk<0 and kk<dd ,最低價(jià),收盤(pán)價(jià),0,0),colorgray;
 
 
音叉

z:zig(4,N);a:=FLATZIG(4,N);q:=datacount; aa:=if(ISLASTBAR,0,a=1 or a=0);
w:barslast(aa),LINETHICK;s:=sum(aa,0);ss:=s[q]-s+1;ba:=barpos;
K:=if(ss<4,4,ss[SYSPARAM(1)]);
xx0:=ref(ba,barssince(ss=K));
xx1:=ref(ba,barssince(ss=K-1));
xx2:=ref(ba,barssince(ss=K-2));
x0:=xx0[q];x1:=xx1[q];x2:=xx2[q];
y0:=z[x0];y1:=z[x1];y2:=z[x2];
x:=(x1+x2)/2;y:=(y1+y2)/2;xL:=(y-y0)/(x-x0);
DRAWSL(ba=x0,z,xL,0,0),COLORMAGENTA,LINEDOT;
DRAWSL(ba=x1,z,xL,0,0),COLORGREEN,LINEDOT;
DRAWSL(ba=x2,z,xL,0,0),COLORGREEN,LINEDOT;
DRAWLINE(ba=x1,z,ba=x2,z,0),COLORGREEN,LINETHICK2;
中:LINEVALUE(ba=x0,z,ba=x0+1,y0+xL,0,0),COLORMAGENTA;
下:LINEVALUE(ba=x1,z,ba=x1+1,y1+xL,0,0),COLORGREEN;
上:LINEVALUE(ba=x2,z,ba=x2+1,y2+xL,0,0),COLORGREEN;
斜率:xL,LINETHICK;
角度:ATAN(xL)*114.6,LINETHICK;
中1:=LINEVALUE(ba=x0,z,ba=x0+1,y0+xL,1,0),COLORMAGENTA;
中0:=if(ba>x1,中,中1);
M1:=LINEVALUE(ba=x1,z,ba=x2,z,0,0);
M2:=LINEVALUE(ba=x1,z,ba=x2,z,1,0);
M:=if(ba>x,m1,m2);
u:=中0-if(y2>y1,下,上);
t0:=中0-u[q]*0.5,LINETHICK,Color005500;
t1:=中0-u[q]*1.5,LINETHICK,Color005500;
t2:=中0-u[q]*2,LINETHICK,Color005500;
wt0:=barssince(cross(t0,m) or cross(m,t0))*0;
wt1:=barssince(cross(t1,m) or cross(m,t1))*0;
wt2:=barssince(cross(t2,m) or cross(m,t2))*0;
t0+wt0,LINEDASHDOT,Color005500;
t1+wt1,LINEDASHDOT,Color005500;
t2+wt2,LINEDASHDOT,Color005500;
u0:=中0+u[q]*0.5,LINETHICK,Color005500;
u1:=中0+u[q]*1.5,LINETHICK,Color005500;
u2:=中0+u[q]*2,LINETHICK,Color005500;
wu0:=barssince(cross(u0,m) or cross(m,u0))*0;
wu1:=barssince(cross(u1,m) or cross(m,u1))*0;
wu2:=barssince(cross(u2,m) or cross(m,u2))*0;
u0+wu0,LINEDASHDOT,Color005500;
u1+wu1,LINEDASHDOT,Color005500;
u2+wu2,LINEDASHDOT,Color005500;
PARTLINE(BETWEEN(m,u2,t2),m),LINETHICK,Color005500;
 

UZ百分比線


UZ百分比線

附件

166424_UZ百分比線.alg (1.43 KB)

2008-6-14 12:51, 下載次數(shù): 53

黃金分割公式


 

{-------------------------------------------------------------}

V1:=REF(C,1);
V2:=SMA(MAX(C-V1,0),6,1)/SMA(ABS(C-V1),6,1)*100;
DRAWICON(IF(CROSS(81,V2),1,0),h*1.01,11);
Var1:=SYSPARAM(3)-SYSPARAM(2)+1;
Var2:=SYSPARAM(3)-BARPOS;
Var3:=HHV(HIGH,Var1);
Var4:=LLV(LOW,VaR1);
Var5:=REFX(Var3,Var2);              //主圖最高價(jià)
Var5:IF(SYSPARAM(3)<>SYSPARAM(1),SYSPARAM(6),Var5),COLORWHITE;
Var6:REFX(Var4,Var2),COLORWHITE;  //主圖最低價(jià)
黃191: (Var5-Var6)*0.191+Var6,COLORWHITE,POINTDOT;
黃382: (Var5-Var6)*0.382+Var6,COLORWHITE,POINTDOT;
黃500: (Var5-Var6)*0.500+Var6,COLORWHITE;
黃618: (Var5-Var6)*0.618+Var6,COLORWHITE,POINTDOT;
黃809: (Var5-Var6)*0.809+Var6,COLORWHITE,POINTDOT;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.0381+Var6,'最低價(jià)('+NUMTOSTR(Var6,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.191+Var6,'黃金0.191('+NUMTOSTR(黃191,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.382+Var6,'黃金0.382('+NUMTOSTR(黃382,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.500+Var6,'黃金分割中軸('+NUMTOSTR(黃500,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.618+Var6,'黃金0.618('+NUMTOSTR(黃618,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.809+Var6,'黃金0.809('+NUMTOSTR(黃809,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.981+Var6,'最高價(jià)('+NUMTOSTR(Var5,2)+')'),COLORWHITE;
zf:=(c/ref(c,4)-1)*100;
s:='z:'+NUMTOSTR(zf[SYSPARAM(1)],2);
DRAWTEXT(BARPOS=SYSPARAM(1),h,s) ALIGN4;
 

穩(wěn)操勝券莊家顯身


//穩(wěn)操勝券莊家顯身



VAR2:=REF(LOW,1);
VAR3:=((SMA(ABS((LOW - VAR2)),3,1) / SMA(MAX((LOW - VAR2),0),3,1)) * 100);
VAR4:=EMA(IF((CLOSE * 1.2),(VAR3 * 10),(VAR3 / 10)),3);
VAR5:=LLV(LOW,38);
VAR6:=HHV(VAR4,38);
VAR7:=IF(LLV(LOW,90),1,0);
VAR8:=((EMA(IF((LOW <= VAR5),((VAR4 + (VAR6 * 2)) / 2),0),3) / 618) * VAR7);
有莊的影子:STICKLINE(VAR8,0,VAR8,6,1),colorFFAAFF;
趨勢(shì)線:(((CLOSE - MA(CLOSE,40)) / MA(CLOSE,40)) * 100),colorAABBDD;
AA:=(((((REF(趨勢(shì)線,1) < REF(趨勢(shì)線,2)) AND (趨勢(shì)線 < (0 - 30))) AND (趨勢(shì)線 >= REF(趨勢(shì)線,1))) OR (REF(CROSS((0 - 30),趨勢(shì)線),1) AND CROSS(趨勢(shì)線,(0 - 30)))) OR (趨勢(shì)線 = (0 - 30)));
DRAWTEXT(AA,500,'砸鍋賣(mài)田買(mǎi)'),colorFFFF;
砸鍋賣(mài)田買(mǎi):IF(AA,500,(0 - 30)),colorFFFF;
BB:=(((((REF(趨勢(shì)線,1) < REF(趨勢(shì)線,2)) AND (趨勢(shì)線 < (0 - 20))) AND (趨勢(shì)線 > (0 - 25))) AND (趨勢(shì)線 >= REF(趨勢(shì)線,1))) OR (REF(CROSS((0 - 20),趨勢(shì)線),1) AND CROSS(趨勢(shì)線,(0 - 20))));
DRAWTEXT(BB,300,'見(jiàn)底信號(hào)'),colorFF;
見(jiàn)底信號(hào):IF(BB,300,(0 - 20)),colorFF;
CC:=(((((REF(趨勢(shì)線,1) < REF(趨勢(shì)線,2)) AND (趨勢(shì)線 < (0 - 25))) AND (趨勢(shì)線 > (0 - 30))) AND (趨勢(shì)線 >= REF(趨勢(shì)線,1))) OR (REF(CROSS((0 - 25),趨勢(shì)線),1) AND CROSS(趨勢(shì)線,(0 - 25))));
DRAWTEXT(CC,400,'莫錯(cuò)失機(jī)會(huì)'),colorFF00;
莫錯(cuò)失機(jī)會(huì):IF(CC,400,(0 - 25)),colorFF00;
底部快顯:IF(CROSS((0 - 20),趨勢(shì)線),100,(0 - 20)),LINETHICK2,colorF0F000;
DRAWTEXT(CROSS((0 - 20),趨勢(shì)線),120,'★'),colorF0F000;
機(jī)會(huì)來(lái)臨:IF(CROSS((0 - 25),趨勢(shì)線),150,(0 - 25)),LINETHICK2,colorF00FF0;
DRAWTEXT(CROSS((0 - 25),趨勢(shì)線),170,'★'),colorF00FF0;
砸鍋賣(mài)田等:IF(CROSS((0 - 30),趨勢(shì)線),200,(0 - 30)),LINETHICK2,colorFFFFFF;
DRAWTEXT(CROSS((0 - 30),趨勢(shì)線),220,'★'),colorFFFFFF;
(0 - 20),POINTDOT,colorFF;
(0 - 25),POINTDOT,color1;
(0 - 30),POINTDOT,colorFFFF;
 

[江恩黃金分割]


input:w(2,1,3);   
年:=MA(CLOSE,26);
STICKLINE(C>=年 AND C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=年 AND C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=年 AND C<O,C,O,7,1),COLORRED;
STICKLINE(C>=年 AND C<O,O,H,0,0),COLORRED;
STICKLINE(C>=年 AND C<O,C,L,0,0),COLORRED;

STICKLINE(C<年 AND C>O,C,O,7,1),COLORffff00;
STICKLINE(C<年 AND C<=O,C,O,7,0),COLORffff00;
STICKLINE(C<年 AND C<=O,H,L,0,1),COLORffff00;
STICKLINE(C<年 AND C>O,C,H,0,1),COLORffff00;
STICKLINE(C<年 AND C>O,O,L,0,1),COLORffff00;

u1:=sysparam(3);
u:=u1-sysparam(2)+1;
hh:=hhv(H,u);
ll:=llv(L,u);
最高:=hh[u1],COLORYELLOW;
PARTLINE(C and w<>3,最高),COLORYELLOW;
最低:ll[u1],COLORred;
PARTLINE(C and w<>3,最低),COLORred;
PARTLINE(C and w=1,最低+(最高-最低)*0.191),LINEDOT,COLORWHITE;
PARTLINE(C and w=1,最低+(最高-最低)*0.382),LINEDOT,COLORWHITE;
PARTLINE(C and w<>3,最低+(最高-最低)*0.5),COLORGREEN;
PARTLINE(C and w=1,最低+(最高-最低)*0.618),LINEDOT,COLORWHITE;
PARTLINE(C and w=1,最低+(最高-最低)*0.809),LINEDOT,COLORWHITE;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(3) and w<>3,REF(最低,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'最低↓'),ALIGN2,COLORred;
DRAWTEXT(BARSCOUNT(C)=SYSPARAM(3) and w<>3,REF(最高,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'最高↑'),ALIGN2,COLORYELLOW;

DRAWTEXT(BARPOS=SYSPARAM(2) and w=1,REF((最低+(最高-最低)*0.191)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'黃金 0.191↑'+NUMTOSTR(最低+(最高-最低)*0.191,2)),COLORWHITE;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=1,REF((最低+(最高-最低)*0.382)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'黃金 0.382↑'+NUMTOSTR(最低+(最高-最低)*0.382,2)),COLORWHITE;
DRAWTEXT(BARPOS=SYSPARAM(2) and w<>3,REF((最低+(最高-最低)*0.5)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM (2))),'     50%  ↑'+NUMTOSTR(最低+(最高-最低)*0.5,2)),COLORGREEN;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=1,REF((最低+(最高-最低)*0.618)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'黃金 0.618↑'+NUMTOSTR(最低+(最高-最低)*0.618,2)),COLORWHITE;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=1,REF((最低+(最高-最低)*0.809)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'黃金 0.809↑'+NUMTOSTR(最低+(最高-最低)*0.809,2)),COLORWHITE;

PARTLINE(C and w=2,最低+(最高-最低)*1/8),LINEDOT,Color0095BC;
PARTLINE(C and w=2,最低+(最高-最低)*1/4),LINEDOT,Color0095BC;
PARTLINE(C and w=2,最低+(最高-最低)*3/8),LINEDOT,Color0095BC;
PARTLINE(C and w=2,最低+(最高-最低)*5/8),LINEDOT,Color0095BC;
PARTLINE(C and w=2,最低+(最高-最低)*7/8),LINEDOT,Color0095BC;
PARTLINE(C and w=2,最低+(最高-最低)*3/4),LINEDOT,Color0095BC;

DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*1/8)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 1/8↑'+NUMTOSTR(最低+(最高-最低)*1/8,2)),Color0095BC;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*1/4)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 1/4↑'+NUMTOSTR(最低+(最高-最低)*1/4,2)),Color0095BC;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*3/8)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 3/8↑'+NUMTOSTR(最低+(最高-最低)*3/8,2)),Color0095BC;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*5/8)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 5/8↑'+NUMTOSTR(最低+(最高-最低)*5/8,2)),Color0095BC;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*7/8)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 7/8↑'+NUMTOSTR(最低+(最高-最低)*7/8,2)),Color0095BC;
DRAWTEXT(BARPOS=SYSPARAM(2) and w=2,REF((最低+(最高-最低)*3/4)*0.996,BARSLAST(BARSCOUNT(C)=SYSPARAM(2))),'江恩 3/4↑'+NUMTOSTR(最低+(最高-最低)*3/4,2)),Color0095BC;


G:=ZIG(3,5)>REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)<=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)<=REF(ZIG(3,5),3);
X:=ZIG(3,5)<REF(ZIG(3,5),1) AND REF(ZIG(3,5),1)>=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)>=REF(ZIG(3,5),3);
DRAWTEXT(G,L*0.997,'▲'),ALIGN1,Colorff00ff;
DRAWTEXT(G,L,' ̄'),ALIGN1,Color00ff00;
DRAWTEXT(X,H*1.002,'▼'),ALIGN1,Color00ffff;
DRAWTEXT(X,H,' ̄'),ALIGN1,Color00ffff;
ED:=barslast(G);
EF:=barslast(X);
買(mǎi)入到賣(mài)出天數(shù):ED,LINETHICK0,ColorFFFFFF;
賣(mài)出到買(mǎi)入天數(shù):EF,LINETHICK0,ColorFFFFFF;
 

真真正正的黃金分割


input:n(30,1,1000);
HH:HHV(H,N);
LL:LLV(L,N);

<%

VH=FFL.VARDATA("HH")

VL=FFL.VARDATA("LL")

VN=FFL.VARDATA("N")

LAST=UBOUND(VH)

IF VN>LAST THEN VN=LAST+1

FOR I=LAST TO LAST-VN+1 STEP-1

    VH(I)=VH(LAST)

    VL(I)=VL(LAST)

NEXT

FFL.VARDATA("HH")=VH

FFL.VARDATA("LL")=VL

FFL.VARSTARTINDEX("HH")=LAST-VN+1

FFL.VARSTARTINDEX("LL")=LAST-VN+1

%>

HH,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,HH,'【黃金分割】↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),HH,HH,2),align2,coloryellow;
LL+((HH-LL)*0.809),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.809),' 0.809↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.809),LL+((HH-LL)*0.809),2),align2,coloryellow;
LL+((HH-LL)*0.764),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.764),' 0.764↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.764),LL+((HH-LL)*0.764),2),align2,coloryellow;
LL+((HH-LL)*0.618),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.618),' 0.618↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.618),LL+((HH-LL)*0.618),2),align2,coloryellow;
LL+((HH-LL)*0.500),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.500),' 0.500↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.500),LL+((HH-LL)*0.500),2),align2,coloryellow;
LL+((HH-LL)*0.382),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.382),' 0.382↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.382),LL+((HH-LL)*0.382),2),align2,coloryellow;
LL+((HH-LL)*0.333),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.333),' 0.333↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.333),LL+((HH-LL)*0.333),2),align2,coloryellow;
LL+((HH-LL)*0.236),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.236),' 0.236↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.236),LL+((HH-LL)*0.236),2),align2,coloryellow;
LL+((HH-LL)*0.191),pointdot,linethick1,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL+((HH-LL)*0.191),' 0.191↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL+((HH-LL)*0.191),LL+((HH-LL)*0.191),2),align2,coloryellow;
LL,coloryellow;
DRAWTEXT(c>0  and ISLASTBAR=1,LL,'〖底部起點(diǎn)〗↑'),coloryellow;
DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL,LL,2),align2,coloryellow;
 

黃金分割線──價(jià)格


//黃金分割線──價(jià)格
DRAWBKBMP(CLOSE>0,'MOON');
STICKLINE(C>=O,C,O,8,0),COLOR0000AA;
STICKLINE(C>=O,C,O,6,0),COLOR0000CC ;
STICKLINE(C>=O,C,O,4,0),COLOR0000DD ;
STICKLINE(C>=O,C,O,2,0),COLOR0000FF;
STICKLINE(C>=O,H,L,0,0),COLORRED;
STICKLINE(C>=O,C,O,8,0),COLOR0000AA;
STICKLINE(C>=O,C,O,6,0),COLOR0000CC ;
STICKLINE(C>=O,C,O,4,0),COLOR0000DD ;
STICKLINE(C>=O,C,O,2,0),COLOR0000FF;
STICKLINE(C>=O,H,L,0,0),COLORRED;
STICKLINE(C<=O,C,O,8,0),Color007B00;
STICKLINE(C<=O,C,O,6,0),Color009000;
STICKLINE(C<=O,C,O,4,0),Color00A800;
STICKLINE(C<=O,C,O,2,0),COLORGREEN;
STICKLINE(C<=O,H,L,0,0),COLORCYAN;
5日:MA(C,5);
20日:MA(C,20);
30日:MA(C,30);
60日:MA(C,60);
Var1:=SYSPARAM(3)-SYSPARAM(2)+1;
Var2:=SYSPARAM(3)-BARPOS;
Var3:=HHV(HIGH,Var1);
Var4:=LLV(LOW,VaR1);
Var5:=REFX(Var3,Var2);              //主圖最高價(jià)
Var5:IF(SYSPARAM(3)<>SYSPARAM(1),SYSPARAM(6),Var5),COLORRED,LINETHICK3;
Var6:REFX(Var4,Var2),COLORWHITE,LINETHICK3;  //主圖最低價(jià)
黃191:(Var5-Var6)*0.191+Var6,COLORYELLOW,POINTDOT,LINETHICK3;
黃382:(Var5-Var6)*0.382+Var6,COLORYELLOW,POINTDOT,LINETHICK3;
黃500:(Var5-Var6)*0.500+Var6,COLORYELLOW;
黃618:(Var5-Var6)*0.618+Var6,COLORYELLOW,POINTDOT,LINETHICK3;
黃809:(Var5-Var6)*0.809+Var6,COLORYELLOW,POINTDOT,LINETHICK3;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.0381+Var6,'最低價(jià)('+NUMTOSTR(Var6,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.191+Var6,'黃金0.191('+NUMTOSTR(黃191,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.382+Var6,'黃金0.382('+NUMTOSTR(黃382,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.500+Var6,'黃金分割中軸('+NUMTOSTR(黃500,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.618+Var6,'黃金0.618('+NUMTOSTR(黃618,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.809+Var6,'黃金0.809('+NUMTOSTR(黃809,2)+')'),COLORWHITE;
DRAWTEXT(SYSPARAM(2)=BARPOS,(Var5-Var6)*0.981+Var6,'最高價(jià)('+NUMTOSTR(Var5,2)+')'),COLORWHITE;
 

時(shí)間之窗[飛狐]主圖


DRAWGBK(DATE>900101,COLORRGB(95,95,95),COLORRGB(0,0,0),1);
Var1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
Var2:=REF(Var1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var3:=REF(Var2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var4:=REF(Var3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var5:=REF(Var4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var6:=REF(Var5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var7:=REF(Var6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var8:=REF(Var7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var9:=REF(Var8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VarA:=REF(Var9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VarB:=REF(VarA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VarC:=REF(VarB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
漲:STICKLINE(Var1 OR Var2 OR Var3 OR Var4 OR Var5 OR Var6 OR Var7 OR Var8 OR Var9 OR VarA OR VarB OR VarC,CLOSE,REF(CLOSE,1),7,1),COLORRED;
VarD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VarE:=REF(VarD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VarF:=REF(VarE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var10:=REF(VarF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var11:=REF(Var10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var12:=REF(Var11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var13:=REF(Var12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var14:=REF(Var13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var15:=REF(Var14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var16:=REF(Var15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
Var17:=REF(Var16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
Var18:=REF(Var17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
跌:STICKLINE(VarD OR VarE OR VarF OR Var10 OR Var11 OR Var12 OR Var13 OR Var14 OR Var15 OR Var16 OR Var17 OR Var18,CLOSE,REF(CLOSE,1),7,1),COLORGREEN;
Var19:=REF(VarD OR VarE OR VarF OR Var10 OR Var11 OR Var12 OR Var13 OR Var14 OR Var15 OR Var16 OR Var17 OR Var18,1) AND Var1;
底:STICKLINE(Var19,REF(CLOSE,1),REF(CLOSE,2),7,0),COLORred;
Var1A:=REF(Var1 OR Var2 OR Var3 OR Var4 OR Var5 OR Var6 OR Var7 OR Var8 OR Var9 OR VarA OR VarB OR VarC,1) AND VarD;
頂:STICKLINE(Var1A,REF(CLOSE,1),REF(CLOSE,2),7,0),COLORBLUE;
a:=BARSCOUNT(c);
ah:=hhv(h,72);
al:=llv(l,72);
a0:=(ah-al)/21;
b1:=l-a0;
stickline((a+0)/13=FLOOR((a+0)/13),b1,b1-3*a0,1,0);
drawtext((a+0)/13=FLOOR((a+0)/13),b1-2.5*a0,'轉(zhuǎn)向時(shí)間窗'),COLORWHITE;
Z10:ZIG(3,10);
Z20:ZIG(3,20);
Z30:ZIG(3,30);
z40:zig(3,40);
z60:zig(3,60);
參照系:ref(z10,1),pointdot,coloryellow;
z10新低點(diǎn):llv(z10,0),pointdot,color00ff00;
zig(3,80);
zig(3,100),color00ff00;
 
 
 

江恩時(shí)間窗


a:=BARSCOUNT(c);
ah:=hhv(h,72);
al:=llv(l,72);
a0:=(ah-al)/21;
b1:=l-a0;
stickline((a+0)/13=FLOOR((a+0)/13),b1,b1-3*a0,1,0);
drawtext((a+0)/13=FLOOR((a+0)/13),b1-2.5*a0,'轉(zhuǎn)向時(shí)間窗'),COLORWHITE;

INPUT:n(20,1,999),上角(50,0,500),下角(50,0,500);
{江恩角度線  周期、角度可調(diào)}
N日:=n*10;
p1:=CLOSE-REF(CLOSE,1);  p2:=SUM(ABS(p1),0); p3:=COUNT(CLOSE>0,0);
k1:=p2/p3/上角*10;  k2:=p2/p3/下角*10;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-0.5*K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH, -K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-2*K2,0,0),COLOR33FFCC;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-4*K2,0,0),COLOR33FFCC,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,HHVBARS(HIGH,N日)+1),N日),HIGH,-8*K2,0,0),COLOR33FFCC,POINTDOT;

DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,0.5*K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW, K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,2*K1,0,0),COLORffCCff;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,4*K1,0,0),COLORffCCff,POINTDOT;
DRAWSL(FILTER(BACKSET(ISLASTBAR,LLVBARS(LOW,N日)+1),N日),LOW,8*K1,0,0),COLORffCCff,POINTDOT;
 
畫(huà)線法__真正高手用的



KDTP
input:n(9),m(3);

RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,M,1);
D:=BARSLAST(CROSS(K,80));
KH:=REF(H,D);
PARTLINE(C<KH,KH),COLORGREEN,POINTDOT;

預(yù)警:CROSS(C,KH);
DRAWTEXT(CROSS(C,KH),L*0.995,'預(yù)警'),COLORGREEN;

KD指標(biāo)K值上穿80時(shí)(條件),取當(dāng)日最高價(jià),向右畫(huà)線,直到某日收盤(pán)價(jià)突破該價(jià)格(突破該線),畫(huà)線結(jié)束。1、作出主圖指標(biāo);2突破時(shí)條件選股(預(yù)警)。


XH-Z  zig-分段信號(hào)

INPUT:N(20,1,100);
M:=(SYSPARAM(4)-SYSPARAM(5))/SYSPARAM(5)*100,LINETHICK0;{確定高低點(diǎn)差}
M1:=IF(DATATYPE>5,M/6,IF(DATATYPE>3,M/8,M/10)),LINETHICK0;{確定ZIG轉(zhuǎn)向參數(shù)}
M1:IF(M1>1,FLOOR(M1),CEILING(M1)),LINETHICK0;

z:=zig(4,M1); f:=z-ref(z,1);
d:=FILTER(refx(f>0 and ref(f,1)<0,1)or BARPOS=1,2);{低點(diǎn)}  
wd:=barslast(d);{低點(diǎn)位置}   
g:=FILTER(refx(f<0 and ref(f,1)>0,1)or BARPOS=1,2);{高點(diǎn)}  
wg:=barslast(g);{高點(diǎn)位置}
xwd:=if(sum(wd=0,2)>1,1,wd)linethick0;//低點(diǎn)位置確認(rèn)
xwg:=if(sum(wg=0,2)>1,1,wg)linethick0;//高點(diǎn)位置確認(rèn)
fd:=hhv(h,xwd)/ref(L,xwd)-1>M1/100;//低點(diǎn)鞏固系數(shù)
fg:=1-LLv(L,xwg)/ref(h,xwg)>M1/100;//高點(diǎn)鞏固系數(shù)
dqz:=BACKSET(ISLASTBAR and wd<wg and fd=0,xwd+1)=0;//低點(diǎn)過(guò)濾系數(shù)
gqz:=BACKSET(ISLASTBAR and wg<wd and fg=0,xwd+1)=0;//高點(diǎn)過(guò)濾系數(shù)
{以下輸出信號(hào)}
dd:dqz*d or BARPOS=1;{輸出低點(diǎn)}
gg:gqz*g or BARPOS=1;{輸出高點(diǎn)}


畫(huà)圓弧
ng\nd均為16

drawtext(sysparam(2)=barpos,c,'板塊:'+blkname),colorccffff,align4;
gg:="xh-z.gg";//(ng);
dd:="xh-z.dd";//(nd);
p:=SYSPARAM(1);
z:=gg*h+dd*L;
sd:=sum(dd,0);
sdd:=sd[p]-sd+1;
wx1:=barssince(sdd=3);
wx2:=barssince(sdd=2);
wx3:=barssince(sdd=1);
ry1:=hhv((wx1=0)*z,0);
ry2:=hhv((wx2=0)*z,0);
ry3:=hhv((wx3=0)*z,0);
rx2:=hhv((wx2=0)*wx1,wx1+1);
rx3:=hhv((wx3=0)*wx1,wx1+1);
x2:=rx2[p];
x3:=rx3[p];
y1:=ry1[p];
y2:=(ry2[p]-ry1[p]);
y3:=(ry3[p]-ry1[p]);
xy:=POW(x2,2)+POW(y2,2);
e:=(x3*xy/x2-(x3*x3+y3*y3))/(y3-x3*y2/x2);
d:=-(y2*e+xy)/x2;
y1:=POW((d*d+e*e)/4-POW((wx1+d/2),2),0.5);
y2:=-POW((d*d+e*e)/4-POW((wx1+d/2),2),0.5);
c1:=ref(L,wx1)-ref(y1,wx1);
yy:=(y1+c1);
c2:=ref(L,wx1)+ref(y1,wx1);
ye:=(y2+c2);
wyy:=abs(ref(yy,wx3)-ref(z,wx3))<0.01;
wye:=abs(ref(ye,wx3)-ref(z,wx3))<0.01;
if wyy[datacount] then
yy,LINETHICK2,COLORMAGENTA;
ELSE
ye,LINETHICK2,COLORMAGENTA;


sg:=sum(gg,0);
sgg:=sg[p]-sg+1;
wxg1:=barssince(sgg=3);
wxg2:=barssince(sgg=2);
wxg3:=barssince(sgg=1);
ryg1:=hhv((wxg1=0)*z,0);
ryg2:=hhv((wxg2=0)*z,0);
ryg3:=hhv((wxg3=0)*z,0);
rxg2:=hhv((wxg2=0)*wxg1,wxg1+1);
rxg3:=hhv((wxg3=0)*wxg1,wxg1+1);
xg2:=rxg2[p];
xg3:=rxg3[p];
yg1:=ryg1[p];
yg2:=(ryg2[p]-ryg1[p]);
yg3:=(ryg3[p]-ryg1[p]);
xyg:=POW(xg2,2)+POW(yg2,2);
eg:=(xg3*xyg/xg2-(xg3*xg3+yg3*yg3))/(yg3-xg3*yg2/xg2);
g:=-(yg2*eg+xyg)/xg2;
yg1:=POW((g*g+eg*eg)/4-POW((wxg1+g/2),2),0.5);
yg2:=-POW((g*g+eg*eg)/4-POW((wxg1+g/2),2),0.5);
cg1:=ref(z,wxg1)-ref(yg1,wxg1);
yyg:=(yg1+cg1);
cg2:=ref(z,wxg1)+ref(yg1,wxg1);
yeg:=(yg2+cg2);
wyyg:=abs(ref(yyg,wxg3)-ref(z,wxg3))<0.01;
wyeg:=abs(ref(yeg,wxg3)-ref(z,wxg3))<0.01;
if wyyg[datacount] then
yyg,LINETHICK2,COLORGREEN;
ELSE
yeg,LINETHICK2,COLORGREEN;
DRAWICON(dd,z,11);
DRAWICON(gg,z,10);




波段畫(huà)線

input:n(5,5,30);
fh:=high; fl:=low;
///以下找歷史最高點(diǎn),hh1表示最高價(jià),phh1表示最高點(diǎn)位置///
hh1:=fh[1]; phh1:=1;
for i=1 to datacount do //從第1條K線開(kāi)始,循環(huán)執(zhí)行下面3條復(fù)合語(yǔ)句,直到K線結(jié)束
if hh1<fh then begin //判斷
hh1:=fh; phh1:=i; //用hh1單值變量記錄歷史最高價(jià),phh1記錄位置
end;

///以下找phh1之后的最低點(diǎn),ll表示最低價(jià),pll最低點(diǎn)位置
if phh1<datacount then begin
ll:=fl[phh1+1];
for i=phh1 to datacount do
if ll>fl then begin
ll:=fl; pll:=i;
end;
end;

///以下用zig轉(zhuǎn)折模擬波段,通過(guò)參數(shù)n來(lái)調(diào)整波的分布///
///找歷史最高后的波峰最高點(diǎn),hh2次高價(jià),phh2位置///
tj:=peakbars(high,n,1)=0;
nstart:=max(lbound(tj),phh1+1);
if nstart<=datacount then begin
hh2:=0;
for i=nstart to datacount do
if tj then begin
if hh2<fh then begin
hh2:=fh;
phh2:=i;
end;
end;
end;

//////以下畫(huà)線///////////
drawline(barpos=phh1,high,barpos=phh2,high,1),colormagenta;
drawline(barpos=phh1,high,barpos=pll,low,1),coloryellow;



波浪+趨勢(shì)

{以下語(yǔ)句為新結(jié)構(gòu)波浪}
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高點(diǎn)}
A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低點(diǎn)}
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低點(diǎn)出現(xiàn)在同一K線上時(shí)可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{過(guò)濾后低點(diǎn)}
L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{過(guò)濾后高點(diǎn)}
DRAWLINE(LD,L,HD,H,0),COLORWHITE,LINETHICK1,POINTDOT;
DRAWLINE(HD,H,LD,L,0),COLORWHITE,LINETHICK1,POINTDOT;
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
{以上語(yǔ)句為新結(jié)構(gòu)波浪}

A3:=H<REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HH:=E3>REF(E3,1);{找出全部長(zhǎng)期高點(diǎn)}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)<REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部長(zhǎng)期低點(diǎn)}
DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1;
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面進(jìn)行過(guò)濾,方法同前。只是不用考慮高低點(diǎn)出現(xiàn)在同一K線}
X3:=REF(BARSLAST(H3),1)+1; F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);  I3:=BACKSET(G3,2);  LZ:=I3>REF(I3,1),LINETHICK0; {長(zhǎng)期低點(diǎn),也可供引用}
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1; F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);  I4:=BACKSET(G4,2);  HZ:=I4>REF(I4,1),LINETHICK0;{長(zhǎng)期高點(diǎn),也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{長(zhǎng)期連線}
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),ISLASTBAR,C,0),COLORGREEN,LINETHICK1; {最后的長(zhǎng)期連線,連在收盤(pán)價(jià)上}

{以下是兩條趨勢(shì)線原碼}
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
DRAWLINE(XX,L,VV,L,1),COLORMAGENTA,LINETHICK1;
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
DRAWLINE(XX2,H,VV2,H,1),COLORMAGENTA,LINETHICK1;

前一低:REF(L,BARSLAST(VV)),COLOR99FF66,POINTDOT,LINETHICK3;
前二低:REF(L,BARSLAST(XX)),COLORFF66FF,POINTDOT,LINETHICK3;
前一高:REF(H,BARSLAST(VV2)),COLOR99FF66,POINTDOT,LINETHICK3;
前二高:REF(H,BARSLAST(XX2)),COLORFF66FF,POINTDOT,LINETHICK3;
短高:=REF(H,BARSLAST(VV2)),LINETHICK0;
短低:=REF(L,BARSLAST(VV)),LINETHICK0;
短比: (C-短低)/(短高-短低),LINETHICK0;

{以下語(yǔ)句是大盤(pán)趨勢(shì)疊加}
常數(shù):=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV));
疊1:INDEXC/常數(shù),COLORGRAY,LINETHICK0;
PARTLINE(1,疊1),COLORGRAY;
常數(shù)2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX));
疊2:INDEXC/常數(shù)2,COLORGRAY,LINETHICK0;
PARTLINE(1,疊2),COLORGRAY;

DRAWNUMBER(HD,1.02*H,DATEDIFF(REF(DATE,BARSLAST(LD)),DATE),0),COLORCYAN;
DRAWNUMBER(LD,0.98*L,DATEDIFF(REF(DATE,BARSLAST(HD)),DATE),0),COLORCYAN;

DRAWNUMBER(HD,H*(1+0.002),H,2),COLORBLUE,ALIGN0;
DRAWNUMBER(LD,L*(1.001-0.002),L,2),COLORBLUE,ALIGN0;
 
JGB

n=3  1  9999

A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);{高點(diǎn)}
A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);{低點(diǎn)}
E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2; E2:=(H+L)/2;{高低點(diǎn)出現(xiàn)在同一K線上時(shí)可作取舍}
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1;
L1:=(D2 AND NOT(D1 AND E1<E2));  H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:I1>REF(I1,1),LINETHICK0;{過(guò)濾后低點(diǎn)}
L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;
X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));
G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:I2>REF(I2,1),LINETHICK0;{過(guò)濾后高點(diǎn)}
DRAWLINE(HD,H,LD,L,0),COLORYELLOW,LINETHICK1;DRAWLINE(LD,L,HD,H,0),COLORYELLOW,LINETHICK1;
{高低點(diǎn)之間作連線。Param#1調(diào)峰點(diǎn)參數(shù)N(3,2,999);}
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORYELLOW;
{作最后的連線。這根線有時(shí)會(huì)不盡人意。}

JGE

n=3    2   9999     m  =1  0  1

HD:="jgb.HD"(N);LD:="jgb.LD"(N);
DRAWLINE(LD,L,HD,H,0),COLORFF9900;DRAWLINE(HD,H,LD,L,0),COLORFF9900;
J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORFF9900;
R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1); S1:=R1>REF(R1,1); {前一高}
T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1); U1:=T1>REF(T1,1); {前一低}
R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2); S2:=R2>REF(R2,1); {前二高}
T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2); U2:=T2>REF(T2,1); {前二低}
短高:REF(H,BARSLAST(S1)),LINETHICK1;   短低:REF(L,BARSLAST(U1)),LINETHICK1;
短比:(C-短低)/(短高-短低),LINETHICK0;
DRAWLINE(S2,H,S1,H,1);          DRAWLINE(U2,L,U1,L,1);
V1:=LINEVALUE(S2,H,S1,H,0,1);   V2:=LINEVALUE(U2,L,U1,L,0,1);
DRAWICON(CROSS(C,V1),V1,4);     DRAWICON(CROSS(V2,C),V2,5);
DRAWICON(CROSS(C,短高),短高,4);  DRAWICON(CROSS(短低,C),短低,5);

A3:=H<REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HZ:=E3>REF(E3,1);{找出全部長(zhǎng)期高點(diǎn)}
  A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
  B4:=REF(L,REF(BARSLAST(LD),1)+1)<REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
  D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LZ:=E4>REF(E4,1);{找出全部長(zhǎng)期低點(diǎn)}
R3:=BACKSET(ISLASTBAR,BARSLAST(HZ)+1); S3:=R3>REF(R3,1); {前一長(zhǎng)高}
T3:=BACKSET(ISLASTBAR,BARSLAST(LZ)+1); U3:=T3>REF(T3,1); {前一長(zhǎng)低}
長(zhǎng)高:REF(H,BARSLAST(S3)),LINETHICK2;   長(zhǎng)低:REF(L,BARSLAST(U3)),LINETHICK2;
長(zhǎng)比:(C-長(zhǎng)低)/(長(zhǎng)高-長(zhǎng)低),LINETHICK0;
PARTLINE(1,長(zhǎng)低+(長(zhǎng)高-長(zhǎng)低)/2),COLORRED; PARTLINE(1,長(zhǎng)低+(長(zhǎng)高-長(zhǎng)低)/3),POINTDOT,COLORDDDDDD;
PARTLINE(1,長(zhǎng)低+2*(長(zhǎng)高-長(zhǎng)低)/3),POINTDOT,COLORDDDDDD;

{下面做大盤(pán)疊加,從可見(jiàn)的第一根K線開(kāi)始。}
A:=BARSCOUNT(C)=SYSPARAM(2); B:=BARSLAST(A); CC:=REF(INDEXC,B)/REF(C,B);
DD1:=INDEXO/CC; DD2:=INDEXH/CC; DD3:=INDEXL/CC; DD4:=INDEXC/CC;
STICKLINE(M AND DD4>=REF(DD4,1),DD3,DD1,0.1,0),COLORFF66FF;
STICKLINE(M AND DD4>=REF(DD4,1),DD4,DD2,0.1,0),COLORFF66FF;
STICKLINE(M AND DD4>=REF(DD4,1),DD1,DD4,7,1),COLORFF66FF;
STICKLINE(M AND DD4<REF(DD4,1),DD3,DD2,0.1,0),COLOR99FF33;
STICKLINE(M AND DD4<REF(DD4,1),DD4,DD1,7,0),COLOR99FF33;
背離系數(shù):100*(C-DD4)/DD4,LINETHICK0;
 
 
 
 
 
 
 
 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶(hù) 評(píng)論公約

    日韩成人午夜福利免费视频| 加勒比系列一区二区在线观看| 日韩性生活视频免费在线观看| 清纯少妇被捅到高潮免费观看| 黄片美女在线免费观看| 在线免费不卡亚洲国产| 亚洲视频在线观看你懂的| 视频一区二区 国产精品| 深夜视频成人在线观看| 日韩欧美在线看一卡一卡| 五月情婷婷综合激情综合狠狠| 国产美女精品人人做人人爽| 妻子的新妈妈中文字幕| 精品欧美日韩一区二区三区| 亚洲欧美日产综合在线网| 日本少妇aa特黄大片| 色婷婷视频在线精品免费观看 | 国产精品一区二区香蕉视频| 日本欧美一区二区三区高清| 久久99午夜福利视频| 亚洲天堂精品在线视频| 国产精品久久男人的天堂| 日韩一级免费中文字幕视频 | 91欧美日韩一区人妻少妇| 国内九一激情白浆发布| 国产免费观看一区二区| 日本妇女高清一区二区三区| 亚洲综合一区二区三区在线| 国语久精品在视频在线观看 | a久久天堂国产毛片精品| 久久福利视频在线观看| 日韩精品中文在线观看| 国内自拍偷拍福利视频| 激情亚洲一区国产精品久久| 国产成人精品在线一区二区三区| 亚洲国产精品无遮挡羞羞| 91超频在线视频中文字幕| 国产成人人人97超碰熟女| 中文字幕免费观看亚洲视频| 亚洲日本中文字幕视频在线观看| 极品熟女一区二区三区|