当前位置: > 热闻

数浪公式+薛斯通道

时间:2022-04-19 16:18:43 热闻 我要投稿

数浪公式+薛斯通道

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="" a2="">0,小通道上) LINETHICK2 COLORRED; PARTLINE(A2=0,小通道上) LINETHICK1 COLORWHITE; PARTLINE(A2<0,小通道上) linethick1="" a3="">0,小通道下) LINETHICK2 COLORRED; PARTLINE(A3=0,小通道下) LINETHICK1 COLORWHITE; PARTLINE(A3<0,小通道下) linethick1="" a4="">0,大通道下) LINETHICK2 COLORRED; PARTLINE(A4=0,大通道下) LINETHICK1 COLORWHITE; PARTLINE(A4<0,大通道下) linethick1="" kxs:="sysparam(2);" dsj:="1;" 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) andref(zig(3,5),2)<=ref(zig(3,5),3)*dsj; ex1:=zig(3,5)=ref(zig(3,5),2) andref(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),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),2)and ref(zig(3,20),2)>=ref(zig(3,20),3)*dsj; pl40:=zig(3,40)*dsj; 走强1:=barslast(pl5ref(pl5,1)); 走强2:=barslast(pl10ref(pl10,1)); 走强3:=barslast(pl20ref(pl20,1)); ztjz5:=if(pl10>ref(pl10,1),count(en1,走强2),0); ztjd5:=if(pl10>ref(pl10,1),count(ex1,走强2),0); dtjz5:=if(pl10<ref(pl10,1),count(en1,走弱2),0); dtjd5:=if(pl10ref(pl20,1),count(en2,走强3),0); ztjd10:=if(pl20>ref(pl20,1),count(ex2,走强3),0); dtjz10:=if(pl20<ref(pl20,1),count(en2,走弱3),0); dtjd10:=if(pl20ref(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) andztjd10=1,h*1.06,"①"),Linethick3,colorffff; drawtext(en2 and pl20>ref(pl20,1) andztjz10=2,l*0.94,"②"),Linethick3,colorffff;

drawtext(ex2 and pl20>ref(pl20,1) and ztjd10=2 or (ztjd10=0 orztjd10=2) and ex2,h*1.06*dsj,"③"),Linethick3,colorffff;

drawtext(en2 and pl20>ref(pl20,1) andztjz10=3,l*0.94,"④"),Linethick3,colorffff;

点石成金

画渐变背景色((收盘价 > 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); {-----------------------功能开关------------------------} jQCB:=EMA(C,3); h1:=h; hh:=hhv(h,21); L1:=L; LL:=llv(L,21); if h1[datacount] =hh[datacount]thenbegin if L1[datacount] =LL[datacount]thenbegin 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); 点石:=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); {未来参考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); 买D5:=P1=0 AND REF(P1,1)=1 AND P2=0 AND REF(P2,1)=1; 卖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); 买点:=FILTER((TROUGHBARS(3,15,1)<4)=1,3);//提前一天 卖点:=FILTER((PEAKBARS(3,15,1)<4)=1,3); d5="" and="" d6="" dscj1="">0,压力),ColorFFB900; //压力--暗蓝 PARTLINE(DScj2>0,点石),ColorFFA6FF; //点石--暗粉 PARTLINE(DScj3>0 and 成金>ref(成金,1),成金),LINETHICK2,Color00A3C1;//成金--金黄 {} DRAWTEXT(Kn AND DScj2>0,点石*0.98,"点石:"+NUMTOSTR(点石[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;

//

新结构波浪

新结构波浪 A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高点} A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低点} E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍} H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; L1:=(D2 AND NOT(D1 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);{过滤后低点} 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);{过滤后高点} 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; {以上语句为新结构波浪} A3:=HREF(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);{找出全部长期高点} A4:=L>REF(L,REF(BARSLAST(LD),1)+1); B4:=REF(L,REF(BARSLAST(LD),1)+1)REF(E4,1);{找出全部长期低点} DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1; H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一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; {长期低点,也可供引用} 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;{长期高点,也可供引用} DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1; DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线} 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; {最后的长期连线,连在收盘价上} {以下是两条趋势线原码} 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; {以下语句是大盘趋势叠加} 常数:=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV)); 叠1:INDEXC/常数,COLORGRAY,LINETHICK0; PARTLINE(1,叠1),COLORGRAY; 常数2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX)); 叠2:INDEXC/常数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;

数浪公式+薛斯通道

v1:=简单移动平均(最高价,30)*1.15 ; v2:=简单移动平均(最高价,3)*1.03; v3:=简单移动平均(最低价,3)*0.97; v4:=简单移动平均(最低价,30)*0.85; {v5}大通道上:傅立叶变换(v1,30); {v6}小通道上:傅立叶变换(v2,30); {v7}小通道下:傅立叶变换(v3,30); {v8}大通道下:傅立叶变换(v4,30); A1:=大通道上-向前引用(大通道上,1); A2:=小通道上-向前引用(小通道上,1); A3:=小通道下-向前引用(小通道下,1); A4:=大通道下-向前引用(大通道下,1); 画分段线(A1>0,大通道上) LINETHICK2 COLORRED; 画分段线(A1=0,大通道上) LINETHICK1 COLORWHITE; 画分段线(A1<0,大通道上) linethick1="" a2="">0,小通道上) LINETHICK2 COLORRED; 画分段线(A2=0,小通道上) LINETHICK1 COLORWHITE; 画分段线(A2<0,小通道上) linethick1="" a3="">0,小通道下) LINETHICK2 COLORRED; 画分段线(A3=0,小通道下) LINETHICK1 COLORWHITE; 画分段线(A3<0,小通道下) linethick1="" a4="">0,大通道下) LINETHICK2 COLORRED; 画分段线(A4=0,大通道下) LINETHICK1 COLORWHITE; 画分段线(A4<0,大通道下) linethick1="" kxs:="系统参数(2);" dsj:="1;" pl5:="之字转向(3,5)*dsj;" en1:="之字转向(3,5)">向前引用(之字转向(3,5),1) and 向前引用(之字转向(3,5),1)<=向前引用(之字转向(3,5),2) and向前引用(之字转向(3,5),2)<=向前引用(之字转向(3,5),3)*dsj; ex1:=之字转向(3,5)<向前引用(之字转向(3,5),1) and="">=向前引用(之字转向(3,5),2) and向前引用(之字转向(3,5),2)>=向前引用(之字转向(3,5),3)*dsj; pl10:=之字转向(3,10)*dsj; en2:=之字转向(3,10)>向前引用(之字转向(3,10),1) and 向前引用(之字转向(3,10),1)<=向前引用(之字转向(3,10),2)and 向前引用(之字转向(3,10),2)<=向前引用(之字转向(3,10),3)*dsj; ex2:=之字转向(3,10)<向前引用(之字转向(3,10),1) and="">=向前引用(之字转向(3,10),2)and 向前引用(之字转向(3,10),2)>=向前引用(之字转向(3,10),3)*dsj; pl20:=之字转向(3,20)*dsj; en3:=之字转向(3,20)>向前引用(之字转向(3,20),1) and 向前引用(之字转向(3,20),1)<=向前引用(之字转向(3,20),2)and 向前引用(之字转向(3,20),2)<=向前引用(之字转向(3,20),3)*dsj; ex3:=之字转向(3,20)<向前引用(之字转向(3,20),1) and="">=向前引用(之字转向(3,20),2)and 向前引用(之字转向(3,20),2)>=向前引用(之字转向(3,20),3)*dsj; pl40:=之字转向(3,40)*dsj; 走强1:=上一次条件成立位置(pl5<向前引用(pl5,1)); 1:="上一次条件成立位置(pl5">向前引用(pl5,1)); 走强2:=上一次条件成立位置(pl10<向前引用(pl10,1)); 2:="上一次条件成立位置(pl10">向前引用(pl10,1)); 走强3:=上一次条件成立位置(pl20<向前引用(pl20,1)); 3:="上一次条件成立位置(pl20">向前引用(pl20,1)); ztjz5:=条件函数(pl10>向前引用(pl10,1),统计总数(en1,走强2),0); ztjd5:=条件函数(pl10>向前引用(pl10,1),统计总数(ex1,走强2),0); dtjz5:=条件函数(pl10<向前引用(pl10,1),统计总数(en1,走弱2),0); dtjd5:=条件函数(pl10<向前引用(pl10,1),统计总数(ex1,走弱2),0); ztjz10:="条件函数(pl20">向前引用(pl20,1),统计总数(en2,走强3),0); ztjd10:=条件函数(pl20>向前引用(pl20,1),统计总数(ex2,走强3),0); dtjz10:=条件函数(pl20<向前引用(pl20,1),统计总数(en2,走弱3),0); dtjd10:=条件函数(pl20<向前引用(pl20,1),统计总数(ex2,走弱3),0); en1="" and="" dtjz5="1,最低价*0.98,"㈠"),colorffff00;" ex1="" dtjd5="2,最高价*1.02,"㈡"),colorffff00;" en2="" ztjz5="1,最低价*0.98,"㈢"),colorffff00;" pl10="">向前引用(pl10,1) and ztjd5=1,最高价*1.02,"⑴"),colorff; 显示文字(en1 and pl10>向前引用(pl10,1) and ztjz5=2,最低价*0.98,"⑵"),colorff; 显示文字(ex1 and pl10>向前引用(pl10,1) and ztjz5=2,最高价*1.02,"⑶"),colorff; 显示文字(en1 and pl10>向前引用(pl10,1) and ztjz5=3,最低价*0.98,"⑷"),colorff; 显示文字(ex2 and pl20>向前引用(pl20,1) and ztjd10=1,最高价*1.02,"⑸"),colorff; 显示文字(en2 and dtjz10=1,最低价*0.94,"Ⅰ"),colorff0000; 显示文字(ex2 and dtjd10=2,最高价*1.06,"Ⅱ"),colorff0000; 显示文字(en3 and ztjz10=1,最低价*0.94,"Ⅲ"),colorff0000; 显示文字(ex2 and pl20>向前引用(pl20,1) andztjd10=1,最高价*1.06,"①"),Linethick3,colorffff; 显示文字(en2 and pl20>向前引用(pl20,1) andztjz10=2,最低价*0.94,"②"),Linethick3,colorffff; 显示文字(ex2 and pl20>向前引用(pl20,1) and ztjd10=2 or (ztjd10=0 orztjd10=2) and ex2,最高价*1.06*dsj,"③"),Linethick3,colorffff; 显示文字(en2 and pl20>向前引用(pl20,1) andztjz10=3,最低价*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:=向前引用(最高价,N)=最高值(最高价,2*N+1); B1:=信号过滤(A1,N); C1:=向前赋值(B1,N+1); D1:=信号过滤(C1,n);{高点} A2:=向前引用(最低价,N)=最低值(最低价,2*N+1); B2:=信号过滤(A2,N); C2:=向前赋值(B2,N+1); D2:=信号过滤(C2,N);{低点} E1:=(向前引用(最低值(最低价,2*N),1)+向前引用(最高值(最高价,2*N),1))/2; E2:=(最高价+最低价)/2;{高低点出现在同一K线上时可作取舍} H1:=(D1 AND 求逻辑非(D2 AND E1>=E2)) OR 数据位置状态=2 OR 有效值周期数(收盘价)=1; L1:=(D2 AND 求逻辑非(D1 AND E1=E2); X1:=向前引用(上一次条件成立位置(H1),1)+1; F1:=向前赋值(H1 AND 统计总数(L1,X1)>0,上一低点位置 (条件函数(L1,最低价,10000),X1)); G1:=F1>向前引用(F1,1); I1:=向前赋值(G1,2); LD:=I1>向前引用(I1,1);{过滤后低点} L2:=LD OR 数据位置状态=2 OR 有效值周期数(收盘价)=1; X2:=向前引用(上一次条件成立位置(L2),1)+1; F2:=向前赋值(L2 AND 统计总数(H2,X2)>0,上一高点位置 (条件函数(H2,最高价,0),X2)); G2:=F2>向前引用(F2,1); I2:=向前赋值(G2,2); HD:=I2>向前引用(I2,1);{过滤后高点} R1:=向前赋值(数据位置状态=2,上一次条件成立位置(HD)+1); S1:=R1>向前引用(R1,1); {前一高} T1:=向前赋值(数据位置状态=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); {前四高} 短期压力:画直线(S2,最高价,S1,最高价,1),Colorred; 短期支撑:画直线(U2,最低价,U1,最低价,1),Colorgreen; 中期压力:画直线(S3,最高价,S2,最高价,1),Coloryellow; 中期支撑:画直线(U3,最低价,U2,最低价,0),Colorgreen; 长期压力:画直线(S4,最高价,S3,最高价,1),COLORFF00FF; 长期支撑:画直线(U4,最低价,U3,最低价,0),Colorgreen; 画图标(S1,最高价*1.01,10); 画图标(S2,最高价*1.01,10); 画图标(S3,最高价*1.01,10); 画图标(S4,最高价*1.01,10); 画图标(U1,最低价*0.99,9); 画图标(U2,最低价*0.99,9); 画图标(U3,最低价*0.99,9); 画图标(U4,最低价*0.99,9); 画柱线(收盘价>=开盘价,开盘价,收盘价,8,0),COLORRED; 画柱线(收盘价>=开盘价,收盘价,最高价,0,0),COLORRED; 画柱线(收盘价>=开盘价,最低价,开盘价,0,0),COLORRED; 画柱线(收盘价<开盘价,收盘价,开盘价,8,0),colorFFFF00; 画柱线(收盘价<开盘价,开盘价,最高价,0,0),colorFFFF00; 画柱线(收盘价<开盘价,最低价,收盘价,0,0),colorffff00; j:="(收盘价*2+最高价+最低价)/4;" k:="(指数平滑移动平均(J,13)" -="" d:="指数平滑移动平均(K,2);" kk:="K-D;" dd:="-1*(K-D);" jj:="交叉函数(kk,dd);" ss2:="移动平均(收盘价,3,1);" ss6:="移动平均(收盘价,5,1);" dk:="2*(ss2-ss6)*15*4*1.5;" dk="">0 and kk0 and kk0 and kk<dd,最低价,收盘价,0,0),COLORgreen; 画柱线(dk<0 and kk<dd, 开盘价,收盘价,8,0),colorgray; 画柱线(dk<0 and kk<dd ,开盘价,最高价,0,0),colorgray; 画柱线(dk<0 and kk<dd ,最低价,收盘价,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);" ba="x2,z,ba=x2+1,y2+xL,0,0),COLORGREEN;" 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百分比线 附件 (1.43 KB)

2008-6-14 12:51, 下载次数: 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); //主图最高价 Var5:IF(SYSPARAM(3)<>SYSPARAM(1),SYSPARAM(6),Var5),COLORWHITE; Var6:REFX(Var4,Var2),COLORWHITE;//主图最低价 黄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,"最低价("+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,"最高价("+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;

稳操胜券庄家显身

//稳操胜券庄家显身 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; 趋势线:(((CLOSE - MA(CLOSE,40)) / MA(CLOSE,40)) * 100),colorAABBDD; AA:=(((((REF(趋势线,1) < REF(趋势线,2)) AND (趋势线 < (0 - 30))) AND (趋势线 >= REF(趋势线,1))) OR (REF(CROSS((0 - 30),趋势线),1) AND CROSS(趋势线,(0 - 30)))) OR (趋势线 = (0 - 30))); DRAWTEXT(AA,500,"砸锅卖田买"),colorFFFF; 砸锅卖田买:IF(AA,500,(0 - 30)),colorFFFF; BB:=(((((REF(趋势线,1) < REF(趋势线,2)) AND (趋势线 < (0 - 20))) AND (趋势线 > (0 - 25))) AND (趋势线 >= REF(趋势线,1))) OR (REF(CROSS((0 - 20),趋势线),1) AND CROSS(趋势线,(0 - 20)))); DRAWTEXT(BB,300,"见底信号"),colorFF; 见底信号:IF(BB,300,(0 - 20)),colorFF; CC:=(((((REF(趋势线,1) < REF(趋势线,2)) AND (趋势线 < (0 - 25))) AND (趋势线 > (0 - 30))) AND (趋势线 >= REF(趋势线,1))) OR (REF(CROSS((0 - 25),趋势线),1) AND CROSS(趋势线,(0 - 25)))); DRAWTEXT(CC,400,"莫错失机会"),colorFF00; 莫错失机会:IF(CC,400,(0 - 25)),colorFF00; 底部快显:IF(CROSS((0 - 20),趋势线),100,(0 - 20)),LINETHICK2,colorF0F000; DRAWTEXT(CROSS((0 - 20),趋势线),120,""),colorF0F000; 机会来临:IF(CROSS((0 - 25),趋势线),150,(0 - 25)),LINETHICK2,colorF00FF0; DRAWTEXT(CROSS((0 - 25),趋势线),170,""),colorF00FF0; 砸锅卖田等:IF(CROSS((0 - 30),趋势线),200,(0 - 30)),LINETHICK2,colorFFFFFF; DRAWTEXT(CROSS((0 - 30),趋势线),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=年 AND 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),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);

买入到卖出天数:ED,LINETHICK0,ColorFFFFFF;

卖出到买入天数: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="" last="UBOUND(VH)" if="">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>0and 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>0and 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>0and 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>0and 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>0and 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>0and 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>0and 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>0and 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>0and 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>0and ISLASTBAR=1,LL,"〖底部起点〗↑"),coloryellow;

DRAWNUMBER(BARSCOUNT(LL)=N-(N-1),LL,LL,2),align2,coloryellow;

黄金分割线──价格

//黄金分割线──价格 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); //主图最高价 Var5:IF(SYSPARAM(3)<>SYSPARAM(1),SYSPARAM(6),Var5),COLORRED,LINETHICK3; Var6:REFX(Var4,Var2),COLORWHITE,LINETHICK3;//主图最低价 黄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,"最低价("+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,"最高价("+NUMTOSTR(Var5,2)+")"),COLORWHITE;

时间之窗[飞狐]主图

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,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,"转向时间窗"),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新低点:llv(z10,0),pointdot,color00ff00;

zig(3,80);

zig(3,100),color00ff00;

江恩时间窗

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,"转向时间窗"),COLORWHITE; INPUT:n(20,1,999),上角(50,0,500),下角(50,0,500); {江恩角度线周期、角度可调} 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; 画线法__真正高手用的 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(C5,M/6,IF(DATATYPE>3,M/8,M/10)),LINETHICK0;{确定ZIG转向参数} 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);{低点} wd:=barslast(d);{低点位置} g:=FILTER(refx(f<0 and="">0,1)or BARPOS=1,2);{高点} wg:=barslast(g);{高点位置} xwd:=if(sum(wd=0,2)>1,1,wd)linethick0;//低点位置确认 xwg:=if(sum(wg=0,2)>1,1,wg)linethick0;//高点位置确认 fd:=hhv(h,xwd)/ref(L,xwd)-1>M1/100;//低点巩固系数 fg:=1-LLv(L,xwg)/ref(h,xwg)>M1/100;//高点巩固系数 dqz:=BACKSET(ISLASTBAR and wd<wg and fd=0,xwd+1)=0;//低点过滤系数 gqz:=BACKSET(ISLASTBAR and wg<wd and fg=0,xwd+1)=0;//高点过滤系数 {以下输出信号} dd:dqz*d or BARPOS=1;{输出低点} gg:gqz*g or BARPOS=1;{输出高点} 画圆弧 ngnd均为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); 波段画线 input:n(5,5,30); fh:=high; fl:=low; ///以下找历史最高点,hh1表示最高价,phh1表示最高点位置/// hh1:=fh[1]; phh1:=1; for i=1 to datacount do //从第1条K线开始,循环执行下面3条复合语句,直到K线结束 if hh1<fh then begin //判断 hh1:=fh; phh1:=i; //用hh1单值变量记录历史最高价,phh1记录位置 end; ///以下找phh1之后的最低点,ll表示最低价,pll最低点位置 if phh1fl then begin ll:=fl; pll:=i; end; end; ///以下用zig转折模拟波段,通过参数n来调整波的分布/// ///找历史最高后的波峰最高点,hh2次高价,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=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; L1:=(D2 AND NOT(D1 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);{过滤后低点} 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);{过滤后高点} 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; {以上语句为新结构波浪} A3:=HREF(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);{找出全部长期高点} A4:=L>REF(L,REF(BARSLAST(LD),1)+1); B4:=REF(L,REF(BARSLAST(LD),1)+1)REF(E4,1);{找出全部长期低点} DRAWICON(HH,H,10),ALIGN2; DRAWICON(LL,L,12),ALIGN1; H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。只是不用考虑高低点出现在同一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; {长期低点,也可供引用} 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;{长期高点,也可供引用} DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1; DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线} 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; {最后的长期连线,连在收盘价上} {以下是两条趋势线原码} 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; {以下语句是大盘趋势叠加} 常数:=REF(INDEXC,BARSLAST(VV))/REF(C,BARSLAST(VV)); 叠1:INDEXC/常数,COLORGRAY,LINETHICK0; PARTLINE(1,叠1),COLORGRAY; 常数2:=REF(INDEXC,BARSLAST(XX))/REF(C,BARSLAST(XX)); 叠2:INDEXC/常数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=319999 A1:=REF(H,N)=HHV(H,2*N+1); B1:=FILTER(A1,N); C1:=BACKSET(B1,N+1); D1:=FILTER(C1,N);{高点} A2:=REF(L,N)=LLV(L,2*N+1); B2:=FILTER(A2,N); C2:=BACKSET(B2,N+1); D2:=FILTER(C2,N);{低点} E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2; E2:=(H+L)/2;{高低点出现在同一K线上时可作取舍} H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1; L1:=(D2 AND NOT(D1 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;{过滤后低点} 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;{过滤后高点} DRAWLINE(HD,H,LD,L,0),COLORYELLOW,LINETHICK1;DRAWLINE(LD,L,HD,H,0),COLORYELLOW,LINETHICK1; {高低点之间作连线。Param#1调峰点参数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; {作最后的连线。这根线有时会不尽人意。} JGE n=3 2 9999 m=101 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:=HREF(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);{找出全部长期高点} A4:=L>REF(L,REF(BARSLAST(LD),1)+1); B4:=REF(L,REF(BARSLAST(LD),1)+1)REF(E4,1);{找出全部长期低点} R3:=BACKSET(ISLASTBAR,BARSLAST(HZ)+1); S3:=R3>REF(R3,1); {前一长高} T3:=BACKSET(ISLASTBAR,BARSLAST(LZ)+1); U3:=T3>REF(T3,1); {前一长低} 长高:REF(H,BARSLAST(S3)),LINETHICK2; 长低:REF(L,BARSLAST(U3)),LINETHICK2; 长比:(C-长低)/(长高-长低),LINETHICK0; PARTLINE(1,长低+(长高-长低)/2),COLORRED; PARTLINE(1,长低+(长高-长低)/3),POINTDOT,COLORDDDDDD; PARTLINE(1,长低+2*(长高-长低)/3),POINTDOT,COLORDDDDDD; {下面做大盘叠加,从可见的第一根K线开始。} 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;

背离系数:100*(C-DD4)/DD4,LINETHICK0;