使命召唤ol美杜莎h:[飞狐] 高手用的画线法【汇总】

来源:百度文库 编辑:学校大全网 时间:2021/06/20 18:14:17
真正的高手,用得都是画线法,包括专业股界人士,庄家和主力都是这样,用公式的人呢,反而都是散户朋友,他们其实都用这一方法,告诉你们,试一试!!!!

首先找到股价在下跌前创新高的地方。记住是下跌前,画一横线,此时不是买入点。切记,如股价继续下跌,在途中又创高。然后又下跌,抹掉第一画线,在第二下跌前画线。如此反复画,反复画,至到有一天,股价上穿此线,此点就是买点,在上升中此理同上,看下图,可直观一些。。

这就是向下推阻力,看突破。反思惟方法
股不涨就跌,道理就这么简单,要想涨,只有突破,不突破,根本谈不上涨。
很多人一直梦想找到万灵的公式,很多高手梦想做出不败的指标,偶对这些人,只能笑一笑,因为是梦想嘛,偶敢断言,将来有一天,你也会放弃机内的公式,简单的看看画线。因为,你已经是一代天骄了!!!!!!!
使用:

方法1:

1。最好结合大盘,顺势而为。

2,建议做形成上升通道的个股(楼梯股,即形成45度左右攀升的个股)和股性活跃的个股,不做ST股PT股。

3,量价结合。(注意是底部还是头部,头部放量要小心,如何判断头部或底部就要凭个人修为了,呵呵)

4。阴线突破,不入,观察。

方法2:

1。超短线1-2日买卖,突破压力位马上进入,次日出现十字星逃或跌破这压力位逃,成交量跟不上逃。

(这方法风险大,不稳健,而且需要洞悉热点板块,不建议初学者用,用时可选择流通盘3000-8000左右,活跃性较强,有题材和想象空间的个股做,尤其可选当日涨幅大于2,量比大于1。《一阳穿三线以上,KDJ相对低位或金叉,MACD低背离或二次金叉等指标辅助可提高安全度》)
超短压力线(加入主图即可)
STICKLINE(CLOSEref(OPEN,1),ref(close,1),ref(close,1),20,0),COLORFFFFFF;

平常常用的压力支持线
RSV:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
RSV12:=(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34))*100;
K12:=SMA(RSV12,3,1);
D12:=SMA(K12,3,1);
J12:=3*K12-2*D12;
RSV24:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
K24:=SMA(RSV24,3,1);
D24:=SMA(K24,3,1);
J24:=3*K24-2*D24;
压力位:IF(CROSS(j24,j),H,REF(H,BARSLAST(CROSS(j24,j)))),COLORred,LINETHICK2;
支撑位:IF(CROSS(j,j24),L,REF(L,BARSLAST(CROSS(j,j24)))),COLOR77AAFF,,LINETHICK2;


上升通道强势股(楼梯股)(源码,加入主图)
AA10:=MA(C,10);
BB10:=atan((aa10-ref(aa10,1)))*180/3.1416;
STICKLINE(BB10>1 and AA10>ref(AA10,1), AA10,REF(AA10,1),8,0),colorred;
STICKLINE(BB10<1 and AA10AA20:=MA(C,20);
BB20:=atan((aa20-ref(aa20,1)))*180/3.1416;
STICKLINE(BB20>1,AA20,REF(AA20,1),8,0),COLORYELLOW;
STICKLINE(BB20<1,AA20,REF(AA20,1),8,1),COLORbbcccc;


CZW-G

input:p1(3,0,30),p2(6,1,300),p3(18,1,300),p4(250,0,300);
Var1:=(C+L+H)/3;
Var2:=eMA(Var1,6);
Var3:=eMA(Var2,5);
Var4:=eMA(Var3,12);
Var5:=eMA(Var4,5);
生命线:eMA(Var3,30),COLORRED,POINTDOT;
DRAWICON(C>=生命线,生命线,10);
DRAWICON(C<生命线,生命线,11);
a:=HHV(MA((L+H+C)/3,3),3);
b:=llv(MA((L+H+C)/3,3),10);
STICKLINE(BARSCOUNT(C)=SYSPARAM(1),a,a,20,0),Coloryellow,linethick3,shift1;
DRAWNUMBER(BARSCOUNT(C)=SYSPARAM(1),a,a,3),shift3,colorYELLOW;
STICKLINE(BARSCOUNT(C)=SYSPARAM(1),b,b,20,0),ColorDB3FDD,linethick3,shift1;
DRAWNUMBER(BARSCOUNT(C)=SYSPARAM(1),b,b,3),shift3,ColorDB3FDD;

DRAWTEXT(sysparam(2)=BARPOS,c,' '+BLKNAME),COLORccffcc,ALIGN4;//板块

a1:=cost(95);
a2:=cost(5);
ly:=(a1-a2)*100/(a1+a2);
drawicon(ly>ref(ly,1), l*0.98,8)ALIGN5;


input:N(3);

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;{过滤后高点}

///HD:="jgb.HD"(N);LD:="jgb.LD"(N);
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); {前二低}
T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2); U3:=T3>REF(T3,1); {前三低}
T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2); U4:=T4>REF(T4,1); {前四低}
R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2); S3:=R3>REF(R3,1); {前三高}
R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2); S4:=R4>REF(R4,1); {前四高}
★压力1:DRAWLINE(S2,H,S1,H,1),Color80FFFF;         
★支撑1:DRAWLINE(U2,L,U1,L,1),POINTDOT,Color00FFFF,linethick2;
★压力2:DRAWLINE(S3,H,S2,H,1),ColorFF8000;
★支撑2:DRAWLINE(U3,L,U2,L,1),POINTDOT,ColorFF8000;         
★压力3:DRAWLINE(S4,H,S3,H,1),Color0000FF;
★支撑3:DRAWLINE(U4,L,U3,L,1)POINTDOT,Color0000FF;
DRAWICON(S2,H*1.01,10); DRAWICON(S3,H*1.01,10);
DRAWNUMBER(S2,H*1.02,H,2),COLORMAGENTA;
DRAWNUMBER(S1,H*1.02,H,2),COLORMAGENTA;
DRAWNUMBER(S3,H*1.02,H,2),COLORMAGENTA;
DRAWICON(U1,L*0.99,11); DRAWICON(U2,L*0.99,11);
DRAWICON(U3,L*0.99,11);DRAWICON(U4,L*0.99,11);
DRAWNUMBER(U1,L*0.98,L,2),COLORCYAN;
DRAWNUMBER(U2,L*0.98,L,2),COLORCYAN;
DRAWNUMBER(U3,L*0.98,L,2),COLORCYAN;
DRAWNUMBER(U4,L*0.98,L,2),COLORCYAN;
STICKLINE(open>=close ,close ,open,0,0 ),COLOR00FF00;
STICKLINE(open>=close ,close ,open,8,0 ),COLOR008800;
STICKLINE(open>=close ,close ,open,7,0 ),COLOR009900;
STICKLINE(open>=close ,close ,open,6,0 ),COLOR00AA00;
STICKLINE(open>=close ,close ,open,5,0 ),COLOR00BB00;
STICKLINE(open>=close ,close ,open,4,0 ),COLOR00CC00;
STICKLINE(open>=close ,close ,open,3,0 ),COLOR00DD00;
STICKLINE(open>=close ,close ,open,2,0 ),COLOR00EE00;
STICKLINE(open>=close ,close ,open,1,0 ),COLOR00FF00;

STICKLINE(close>open,close,open,0,0) ,COLORFFBBFF;
STICKLINE(close>open,close,open,8,0) ,COLORFF00FF;
STICKLINE(close>open,close,open,7,0) ,COLORFF22FF;
STICKLINE(close>open,close,open,6,0) ,COLORFF44FF;
STICKLINE(close>open,close,open,5,0) ,COLORFF66FF;
STICKLINE(close>open,close,open,4,0) ,COLORFF88FF;
STICKLINE(close>open,close,open,3,0) ,COLORFF99FF;
STICKLINE(close>open,close,open,2,0) ,COLORFFAAFF;
STICKLINE(close>open,close,open,1,0) ,COLORFFBBFF;




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预警:CROSS(C,KH);
DRAWTEXT(CROSS(C,KH),L*0.995,'预警'),COLORGREEN;

KD指标K值上穿80时(条件),取当日最高价,向右画线,直到某日收盘价突破该价格(突破该线),画线结束。1、作出主图指标;2突破时条件选股(预警)。


XH-Z zig-分段信号

INPUT:N(20,1,100);
M:=(SYSPARAM(4)-SYSPARAM(5))/SYSPARAM(5)*100,LINETHICK0;{确定高低点差}
M1:=IF(DATATYPE>5,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 ref(f,1)>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 wdgqz:=BACKSET(ISLASTBAR and wg{以下输出信号}
dd:dqz*d or BARPOS=1;{输出低点}
gg:gqz*g or BARPOS=1;{输出高点}


画圆弧

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);


波段画线

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 hh1hh1:=fh; phh1:=i; //用hh1单值变量记录历史最高价,phh1记录位置
end;

///以下找phh1之后的最低点,ll表示最低价,pll最低点位置
if phh1ll:=fl[phh1+1];
for i=phh1 to datacount do
if ll>fl 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 hh2hh2:=fh;
phh2:=i;
end;
end;
end;

//////以下画线///////////
drawline(barpos=phh1,high,barpos=phh2,high,1),colormagenta;
drawline(barpos=phh1,high,barpos=pll,low,1),coloryellow;


波浪+趋势

{以下语句为新结构波浪}
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:=HB3:=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);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>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;


波浪结构

input:n(20),n1(7),n2(69);

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 BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
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,1000000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
L2:=LD OR BARSTATUS=2 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(BARSTATUS=2,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
A3:=H; 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);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H,5),ALIGN1;      DRAWICON(LL,L,4),ALIGN1;
H3:=HH OR BARSTATUS=2 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); {长期低点,也可供引用}
L4:=LZ OR BARSTATUS=2 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);{长期高点,也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线}
K1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),BARSTATUS=2,C,0),COLORGREEN,LINETHICK1; {最后的长期连线,连在收盘价上}
UU:=BACKSET(BARSTATUS=2,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(BARSTATUS=2,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));
短低:=REF(L,BARSLAST(VV));
短比: (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(叠2,1),COLORGRAY;
{
s:=NUMTOSTRN(DAYS1970-DATETOD1970(REF( DATE,BARSLAST(LD) ) ),0 );
s1:=NUMTOSTRN(DAYS1970-DATETOD1970(REF( DATE,BARSLAST(HD) ) ),0 );
s2:=NUMTOSTRN(H,2 );
s3:=NUMTOSTRN(L,2 );
DRAWTEXT(HD,1.02*H,s),COLORCYAN;
DRAWTEXT(LD,0.98*L,s1),COLORCYAN;
DRAWTEXT(HD,H*(1+0.002),s2),COLORBLUE,ALIGN0;
DRAWTEXT(LD,L*(1.001-0.002),s3),COLORBLUE,ALIGN0;}

{以下语句为三角形部分}

底:REF(L,BARSLAST(VV)),COLORred,LINETHICK2;
顶:REF(H,BARSLAST(VV2)),COLORGreen,LINETHICK2;

{下迭三角形:蓝色三角形画完介入}
StickLine(VV,顶,底,0,0),Colorff6633,linethick3;{}
DRAWLINE(VV2,H,VV,L,0),Colorff6633,linethick3;{斜}
DRAWLINE(VV2,H,VV,顶,0),Colorff6633,linethick3;{?}

{DRAWLINE(c>0,H,VV,L,0),Colorcyan,linethick2;}{斜}
{DRAWLINE(c>1,H,VV,顶,0),Colorcyan,linethick2;}{?}
{上涨三角形:红色三角形画完出局}
StickLine(VV2 ,顶,底,0,0),Colorred,linethick3;{}
DRAWLINE(VV,L,VV2,H,0),Colorred,linethick3;{斜}
DRAWLINE(VV,L,VV2,底,0),Colorred,linethick3;{?};
SYSPARAM(6),colorwhite;
M3: EMA(CLOSE,3);
M8: EMA(CLOSE,8),  COLORGREEN;
M13: EMA(M8,13),  COLORRED;
M62: EMA(M8,62),  COLORCYAN;
Var1:=EMA(M13,62);
M81: EMA(M62,81),  COLORYELLOW;
M144: EMA(Var1,144),LINETHICK2 , COLORRED;
M250: EMA(Var1,250),LINETHICK2 , COLORMAGENTA;
Var2:=(CLOSE+HIGH+LOW)/3;
Var3:=EMA(Var2,10);
Var4:=REF(Var3,1);
STICKLINE(Var3>Var4,Var3,Var4,15,0),  COLORYELLOW;
STICKLINE(Var3< Var4,Var3,Var4,20,0),  COLOR00ff00;
Var5:=(REF(HIGH,1)+REF(LOW,1))/2;
Var6:=MA(CLOSE,N)+2*STD(CLOSE,N);
DRAWICON(CROSS(Var5,Var6),HIGH*1.035,1);
DRAWTEXT(CROSS(Var5,Var6),HIGH*1.04,'卖出'),  COLORGREEN;
Var7:=REF(CLOSE,1);
Var8:=SMA(MAX(CLOSE-Var7,0),N1,1)/SMA(ABS(CLOSE-Var7),N1,1)*100;
Var9:=CROSS(N2,Var8);
VarA:=FILTER(Var9,4);
DRAWICON(VarA,HIGH*1.035,1);
DRAWTEXT(VarA,HIGH*1.04,'卖出'),  COLORWHITE;
VarB:=(2*CLOSE+HIGH+LOW)/4;
VarC:=LLV(LOW,34);
VarD:=HHV(HIGH,34);
VarE:=EMA((VarB-Var1)/(Var5-Var1)*100,7);
VarF:=EMA(0.667*REF(VarE,1)+0.333*VarE,5);
DRAWTEXT(IF(COUNT(CLOSE< REF(CLOSE,1),8)/8>0.6 AND VOL>=1.5*MA(VOL,5) AND COUNT(VarE>=VarF,3) AND REF(LOW,1)<=LLV(LOW,120),1,0),LOW,'●买进'),  colorred;
DRAWTEXT(IF(COUNT(CLOSE< REF(CLOSE,1),13)/13>0.6 AND COUNT(VarE>VarF,6) AND REF(LOW,5)=LLV(LOW,120) AND REF(CLOSE>=OPEN,4) AND REF(CLOSE>OPEN,3) AND REF(CLOSE>OPEN,2) AND REF(OPEN>CLOSE,1) AND OPEN>REF(CLOSE,1),1,0),LOW,'●买进'),  COLORYELLOW;
Var10:=MA(CLOSE,80)-MA(CLOSE,10)/3;
DRAWTEXT(IF(CLOSE< Var10 AND VOL/240>MA(VOL,5)/240 AND CLOSE>REF(CLOSE,1)*1.08 AND CLOSE< MA(CLOSE,13)*1.3,1,0),LOW,'●抄底'),  COLORRED;


大鲨鱼形态-画线预警

SFF:=H/REF(H,1)<1 AND REF(h,1)/REF(h,2)<1  AND L/REF(L,1)>1 and REF(L,1)/REF(L,2)>1 ;
STICKLINE(BACKSET(SFF,3),C,O,7,1),COLORYELLOW;
DRAWTEXT(SFF,L*0.97,'大鲨鱼'),COLORYELLOW;
w:=barslast(FILTER(BACKSET(SFF,3),3));
预警:cross(c,ref(h,w))LINETHICK0;
DRAWLINE(FILTER(BACKSET(SFF,3),3),h,cross(c,ref(h,w)),ref(h,w),0);


顶底画线

DRAWLINE(l=sysparam(5),l,barpos=SYSPARAM(3)-1,l,1),Colorgreen;
DRAWLINE(h=sysparam(4),h,barpos=SYSPARAM(3)-1,h,1),Coloryellow;
  
x:=ma(c,5);
n1:=sysparam(3);
n:=n1-sysparam(2)+1;
hh:=hhv(x,n);
ll:=llv(x,n);
tsh:=hhvbars(x,n);
tsl:=llvbars(x,n);
最高:hh[n1],POINTDOT;
最低:ll[n1],POINTDOT;
drawicon(barpos=n1-tsh[n1],l,5);
drawicon(barpos=n1-tsl[n1],l,4);
drawtext(barpos=n1-tsh[n1],h*1.02,'大顶')colorred;
drawtext(barpos=n1-tsl[n1],l*0.99,'大底')colorgreen;

dx:=ma(indexc,5);
dn1:=sysparam(3);
dn:=dn1-sysparam(2)+1;
dhh:=hhv(dx,dn);
dll:=llv(dx,dn);
dtsh:=hhvbars(dx,dn);
dtsl:=llvbars(dx,dn);
d最高:=dhh[dn1];
d最低:=dll[dn1];
drawicon(barpos=dn1-dtsh[dn1],l,11);
drawicon(barpos=dn1-dtsl[dn1],l,10);
drawtext(barpos=dn1-dtsh[dn1],h*1.02,'顶')colorblue;
drawtext(barpos=dn1-dtsl[dn1],l,'底')coloryellow;

{K线}
stickline(c=o and c>ref(c,1),c,o,8,0),Colorred;
stickline(c=o and cstickline(c=o and c>ref(c,1),h,l,0,0),Colorred;
stickline(c=o and c<=ref(c,1),h,l,0,0)Colorcyan;
stickline(c=o and c<=ref(c,1),c,o,8,0)Colorcyan;

stickline(c>o,h,l,0,0),Colorred;
stickline(cstickline(c>o,c,o,8,0),Colorred;
stickline(c

高低飞翔


input:n(5),峰(1),开始时(1010101,9000101,1341231);

//1、高点——高点之后的波峰 画红线;2、高点——最低点 画黄线或绿线;
FC:=C;FZ:=if(ZIG(C,n)>ref(ZIG(C,n),1) and ZIG(C,n)>refx(ZIG(C,n),1),ZIG(C,n),0);//序列变量赋值
KS:=DATACOUNT-BARSSINCE(DATE>开始时);//设定参数选择开始时间
n1:=SORT(FC,0,KS[DATACOUNT],DATACOUNT); //排序
高:FC[datacount],LINETHICK0;
GS:=DATACOUNT-BARSLAST(高=C)+30;//限制波段次高点(峰)在高点之后(右边)
n2:=SORT(FZ,0,GS[DATACOUNT],DATACOUNT);//排序
中:FZ[datacount+1-峰],COLORMAGENTA,LINETHICK0;//设定参数选择第几个次高点(峰)
低:FC[ks[DATACOUNT]],COLORYELLOW,LINETHICK0;//这个低点可能在高点之前
//画线
drawline(高=C AND DATE>开始时,C,低=C,C,1),COLORYELLOW;
drawline(低=C AND DATE>开始时,C,高=C,C,0),COLORGREEN;
drawline(高=C AND DATE>开始时,C,中=C,C,1),COLORMAGENTA,LINEDOT;

1、高点——高点之后的波峰 画红线;
2、高点——最低点 画黄线或绿线;


红蓝三角


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 BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
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 BARSTATUS=2 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(BARSTATUS=2,MIN(BARSLAST(HD),BARSLAST(LD))+1); J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1,POINTDOT;
A3:=H; 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);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
DRAWICON(HH,H,5),ALIGN1;   DRAWICON(LL,L,4),ALIGN1;
H3:=HH OR BARSTATUS=2 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); {长期低点,也可供引用}
L4:=LZ OR BARSTATUS=2 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);{长期高点,也可供引用}
DRAWLINE(HZ,H,LZ,L,0),COLORGREEN,LINETHICK1;
DRAWLINE(LZ,L,HZ,H,0),COLORGREEN,LINETHICK1;{长期连线}
K1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HZ),BARSLAST(LZ))+1); K2:=K1>REF(K1,1);
DRAWLINE(K2,IF(HZ,H,L),BARSTATUS=2,C,0),COLORGREEN,LINETHICK1; {最后的长期连线,连在收盘价上}
UU:=BACKSET(BARSTATUS=2,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(BARSTATUS=2,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));
短低:=REF(L,BARSLAST(VV));
短比: (C-短低)/(短高-短低),LINETHICK0;

{以下语句为三角形部分}

底:REF(L,BARSLAST(VV)),COLORred,LINETHICK2;
顶:REF(H,BARSLAST(VV2)),COLORGreen,LINETHICK2;

{下迭三角形:蓝色三角形画完介入}
StickLine(VV,顶,底,0,0),Colorff6633,linethick3;{}
DRAWLINE(VV2,H,VV,L,0),Colorff6633,linethick3;{斜}
DRAWLINE(VV2,H,VV,顶,0),Colorff6633,linethick3;{?}

{DRAWLINE(c>0,H,VV,L,0),Colorcyan,linethick2;}{斜}
{DRAWLINE(c>1,H,VV,顶,0),Colorcyan,linethick2;}{?}
{上涨三角形:红色三角形画完出局}
StickLine(VV2 ,顶,底,0,0),Colorred,linethick3;{}
DRAWLINE(VV,L,VV2,H,0),Colorred,linethick3;{斜}
DRAWLINE(VV,L,VV2,底,0),Colorred,linethick3;{?};

划线指标

M:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));
DRAWSL(BARPOS=SYSPARAM(1),LOW,15*M/50,0,0),COLORWHITE;
DRAWSL(BARPOS=SYSPARAM(1),LOW,30*M/50,0,0),COLORGREEN;
DRAWSL(BARPOS=SYSPARAM(1),LOW,45*M/50,0,0),COLORMAGENTA;
DRAWSL(BARPOS=SYSPARAM(1),LOW,75*M/50,0,0),COLORCYAN;
DRAWSL(BARPOS=SYSPARAM(1),HIGH,-75*M/50,0,0),COLORWHITE;
DRAWSL(BARPOS=SYSPARAM(1),HIGH,-60*M/50,0,0),COLORGREEN;
DRAWSL(BARPOS=SYSPARAM(1),HIGH,-45*M/50,0,0),COLORMAGENTA;
DRAWSL(BARPOS=SYSPARAM(1),HIGH,-15*M/50,0,0),COLORCYAN;


画抛物线

input:nd(16),ng(16);

drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd"(nd);
gg:="xh-z.gg"(ng);
sd:=sum(dd,0);
p:=SYSPARAM(1);
q:=SYSPARAM(3);
sdd:=sd[p]-sd+1;
wx0:=barssince(sdd=4);
wx1:=barssince(sdd=3);
wx2:=barssince(sdd=2);
wx3:=barssince(sdd=1);
rx2:=hhv((wx2=0)*wx1,0);X2:=rx2[p];
rx3:=hhv((wx3=0)*wx1,0);X3:=rx3[p];
ry1:=hhv((wx1=0)*L,0);Y1:=ry1[p];
ry2:=hhv((wx2=0)*L,0);Y2:=ry2[p]-y1;
ry3:=hhv((wx3=0)*L,0);Y3:=ry3[p]-y1;
XS:=POW(X3,0.5);XE:=POW(X2,0.5);
K:=(XS*Y2-XE*Y3)/(XS*X2-XE*X3);
d:=POW(Y2-K*X2,2)/X2;
YY1:=POW(D*WX1,0.5)+K*WX1;
R1:=Y1-REF(YY1,WX1);
YY:=(YY1+R1);
YY2:=-POW(D*WX1,0.5)+K*WX1;
R2:=Y1-REF(YY2,WX1);
YE:=(YY2+R2);
wyy:=abs(ref(yy,wx3)-ref(L,wx3))<0.01;
wye:=abs(ref(ye,wx3)-ref(L,wx3))<0.01;
if wyy[p] then
低:yy,LINETHICK2,COLORMAGENTA;
ELSE
低1:ye,LINETHICK2,COLORMAGENTA;
sg:=sum(gg,0);
sgg:=sg[p]-sg+1;
wxg0:=barssince(sgg=4);
wxg1:=barssince(sgg=3);
wxg2:=barssince(sgg=2);
wxg3:=barssince(sgg=1);
rxg2:=hhv((wxg2=0)*wxg1,0);Xg2:=rxg2[p];
rxg3:=hhv((wxg3=0)*wxg1,0);Xg3:=rxg3[p];
ryg1:=hhv((wxg1=0)*h,0);Yg1:=ryg1[p];
ryg2:=hhv((wxg2=0)*h,0);Yg2:=ryg2[p]-yg1;
ryg3:=hhv((wxg3=0)*h,0);Yg3:=ryg3[p]-yg1;
XSg:=POW(Xg3,0.5);XEg:=POW(Xg2,0.5);
Kg:=(XSg*Yg2-XEg*Yg3)/(XSg*Xg2-XEg*Xg3);
g:=POW(Yg2-Kg*Xg2,2)/Xg2;
YYg1:=POW(g*WXg1,0.5)+Kg*WXg1;
Rg1:=Yg1-REF(YYg1,WXg1);
YYg:=(YYg1+Rg1);
YYg2:=-POW(g*WXg1,0.5)+Kg*WXg1;
Rg2:=Yg1-REF(YYg2,WXg1);
YEg:=(YYg2+Rg2);
wyyg:=abs(ref(yyg,wxg3)-ref(h,wxg3))<0.01;
wyeg:=abs(ref(yeg,wxg3)-ref(h,wxg3))<0.01;
if wyyg[p] then
高:yyg,LINETHICK2,Color89FF50;
ELSE
高1:yeg,LINETHICK2,Color89FF50;
DRAWICON(wx0>=0 and (dd or gg),dd*L+gg*h,12);
DRAWICON(wx3=0 or wxg3=0,dd*L+gg*h,10);
tt:='高\n \n'+NUMTOSTR(if(wyyg[p],yyg[q],yeg),3)+'\n \n \n \n 低\n \n'+NUMTOSTR(if(wyy[p],yy[q],ye[q]),3);
DRAWTEXT(BARPOS=q-5,h,tt)SHIFT1,ALIGN4;


画趋势线


input:n(16),m(0);

drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
z:=zig(4,n);p:=SYSPARAM(1);
dd:="xh-z.dd"(n);  wd:=barslast(dd);  
sd:=sum(dd,0);  di:=sd[p]-sd+1;    id:=(digg:="xh-z.gg"(n);  wg:=barslast(gg);  
sg:=sum(gg,0);  gi:=sg[p]-sg+1;    ig:=(gitd0:=barslast(di[p]=id);
td1:=barslast(1+di[p]=id);
td2:=barslast(2+di[p]=id);
x:ref(z,td0),POINTDOT;
k1:(x-ref(z,td1))/ref(td1,td0)*100,LINETHICK0,COLORGREEN;
k3:(ref(z,td1)-ref(z,td2))/ref(td2,td1)*100,LINETHICK0,Color5E7159;
x1:x+td0*k1/100,LINETHICK0,COLORGREEN;
x2:ref(z,td1)+td1*k3/100,LINETHICK0,Color5E7159;
DRAWLINE(1+di[p]=id,z,di[p]=id,z,1),COLORGREEN;
DRAWLINE(2+di[p]=id,z,1+di[p]=id,z,1),Color5E7159,POINTDOT;
tg0:=barslast(gi[p]=ig);
tg1:=barslast(1+gi[p]=ig);
tg2:=barslast(2+gi[p]=ig);
s:ref(z,tg0),POINTDOT;
k2:(s-ref(z,tg1))/ref(tg1,tg0)*100,LINETHICK0,COLORMAGENTA;
k4:(ref(z,tg1)-ref(z,tg2))/ref(tg2,tg1)*100,LINETHICK0,Color546C82;
s1:s+tg0*k2/100,LINETHICK0,COLORMAGENTA;
s2:ref(z,tg1)+tg1*k4/100,LINETHICK0,Color546C82;
DRAWLINE(1+gi[p]=ig,z,gi[p]=ig,z,1),COLORMAGENTA;
DRAWLINE(2+gi[p]=ig,z,1+gi[p]=ig,z,1),Color546C82,POINTDOT;
DRAWICON((dd and di<5) or (gg and gi<5),z,12);
DRAWICON(di[p]=id or gi[p]=ig,z,10);


画速阻力线

input:n(16);

drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd"(n);
gg:="xh-z.gg"(n);
z:=dd*L+gg*h;
gd:=gg+dd;
DRAWICON(dd,z,12);
p:=SYSPARAM(1);
sgd:=sum(gd,0);
gds:=sgd[p]-sgd+1;
sb:=if(gds<1,1,gds);
sa:=(sbhb:=hhv((sa=1)*BARPOS,0);
q:=hb[p];
wgd:=ref(barslast(gd),1)+1;
DRAWICON(gd,dd*L+gg*h,12);
hgd:=if(gg,h,if(dd,L,0));
Lgd:=if(gg,ref(L,wgd),if(dd,ref(h,wgd),0));
yhL:=(hgd-Lgd)/4;
oo:=CROSS(BACKSET(q=BARPOS,wgd[q]+1),0.5);{定点}
qz:=(wgd[q])*4/3;{画斜线1}
w:=sumbars(gd,2)-1;
K1:=(hgd[q]-Lgd[q])/qz*4/3,LINETHICK0;
d1:ref(z,w)+k1*w,LINETHICK0,ColorFF6FB7;
K2:=(hgd[q]-Lgd[q])/qz/1.123,LINETHICK0;
d2:ref(z,w)+k2*w,LINETHICK0,ColorFF6FB7;
K3:=(hgd[q]-Lgd[q])/qz/2.246,LINETHICK0;
d3:ref(z,w)+k3*w,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k1,0,0),LINETHICK1,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k2,0,0),POINTDOT,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k3,0,0),POINTDOT,ColorFF6FB7;


画斜线2

b1:=(Lgd[q]-hgd[q])/qz*4/3,LINETHICK0;
g1:ref(hgd[q],w)+b1*w,LINETHICK0,Color74AFFF;
b2:=(Lgd[q]-hgd[q])/qz/1.132,LINETHICK0;
g2:ref(hgd[q],w)+b2*w,LINETHICK0,Color74AFFF;
b3:=(Lgd[q]-hgd[q])/qz/2.246,LINETHICK0;
g3:ref(hgd[q],w)+b3*w,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],b1,0,0),Color74AFFF,LINETHICK1;
DRAWSL(oo,hgd[q],b2,0,0),POINTDOT,Color74AFFF;
DRAWSL(oo,hgd[q],b3,0,0),POINTDOT,Color74AFFF;
i1:='斜率\nk1\n'+'±'+NUMTOSTR(abs(k1)*100,3)+'\nk2\n'+'±'
+NUMTOSTR(abs(k2)*100,3)+'\nk3\n'+'±'+NUMTOSTR(abs(k3)*100,3);
DRAWTEXT(BARPOS=SYSPARAM(3)-15,h,i1),ALIGN4,SHIFT1,Color74AFFF;


画线

A:=HHVBARS(HIGH,0)+1;
T:=SUM(BACKSET(ISLASTBAR,HHVBARS(HIGH,0)),0);
B:=ISLASTBAR;
HH:LINEVALUE(A=1 ,H,B,H,0,0);
CC:ALL(HH>H,T);

TT:=SUM(BACKSET(ISLASTBAR,HHVBARS(HIGH,0)),0);
AA:=HHVBARS(HIGH,TT)+1;
T1:=SUM(BACKSET(ISLASTBAR,HHVBARS(HIGH,TT)),0);;
BB:=ISLASTBAR;
HH1:LINEVALUE(AA=1 ,H,BB,H,0,0);
CCCC:ALL(HH1>H,T1);

1。
A:历史最高点;
B:今日最高点;
画AB线;
CC:从A对应日期至今日,中间所有K线的最高点小于AB线;

2。
AA:历史最高点向右数第二高点;
BB:今日最高点;
画AABB线;
CCCC:从A对应日期至今日,中间所有K线的最高点小于AABB线;



画线性回归通道



input:t(60);
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
p:=if(SYSPARAM(1)Ax:=p=BARPOS;//A点横坐标
yk:=slope(c,t+1);//通道斜率
yc:=forcast(c,t+1);
Ay:=yc[p+t]-yk[p+t]*t;//A点纵坐标
Bx:=ref(Ax,t);//B点横坐标
By:=yc[p+t];//B点纵坐标
中:LINEVALUE(Ax,Ay,Bx,By,0,0);
js:=hhv(h-中,t+1);
jq:=hhv(中-L,t+1);
上:LINEVALUE(Ax,Ay+js[p+t],Bx,By+js[p+t],0,0);
下:LINEVALUE(Ax,Ay-jq[p+t],Bx,By-jq[p+t],0,0);
STICKLINE(Ax or Bx,上,下,0.01,0)COLORGRAY,POINTDOT;
K:=(中-ref(中,t))/t;//(refx(中,t)-中)/中/t*100;
斜y:k,linethick0;
斜%:K[p+t]/中*100,linethick0;
宽%:((上-下)*cos(atan(K[p+t]))/下[p+t])*100,linethick0;//相对宽度
宽y:(上-下)*cos(atan(K[p+t])),linethick0;//绝对宽度


画线性回归通道1


drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd";//(n);
gg:="xh-z.gg";//(n);
gd:=FILTER(dd+gg,4);
dg:=barslast(gd);
p:=SYSPARAM(1);
Sgd:=sum(gd,0);
gdS:=Sgd[p]-Sgd+1;
W1:=barssince(gdS=gdS[p]);
if w1[p]>1 then begin
Bx:=p=BARPOS;
By:=forcast(c,W1[p]+1);
Ax:=W1=0;
Ay:=By[p]-refx(SLOPE(c,W1[p]+1),W1[p])*W1[p];
zx:LINEVALUE(Ax,Ay,Bx,By,0,0)COLORYELLOW;
sh:=hhv(h-zx,w1+1);
sL:=hhv(zx-L,w1+1);
sx:LINEVALUE(Ax,Ay+sh[p],Bx,By+sh,0,0)COLORMAGENTA;
xx:LINEVALUE(Ax,Ay-sL[p],Bx,By-sL,0,0)COLORGREEN;
STICKLINE(Ax or Bx,xx,sx,0.1,0)POINTDOT,ColorD9FF76;end;
K:=(by[p]-ay[p-w1[p]])/W1[p];
斜:k*100,LINETHICK0;
宽:abs((sx-xx)*cos(ATAN(k)*5.73)),LINETHICK0;
宽%:宽/zx[p]*100,LINETHICK0;
DRAWICON(w1=0,dd*L+gg*h,12);


价量时空

INPUT:N(5);
DRAWGBK(C, COLORRGB(50,50,0), COLORRGB(50,100,0),1);
a0:=BARSCOUNT(c);a3:=SYSPARAM(3);a2:=SYSPARAM(2);
a4:=SYSPARAM(4);a5:=SYSPARAM(5);
nn0:=a3-a2;nn:=a0-a2;hh1:=(a4-a5)/10;
y0:=a0>=a2;vv0:=if(y0=1 and SYSPARAM(1)>=a0,v,0);
c1:=if(BETWEEN(c,a4-0*hh1,a4-1*hh1),vv0,0);
c2:=if(BETWEEN(c,a4-1*hh1,a4-2*hh1),vv0,0);
c3:=if(BETWEEN(c,a4-2*hh1,a4-3*hh1),vv0,0);
c4:=if(BETWEEN(c,a4-3*hh1,a4-4*hh1),vv0,0);
c5:=if(BETWEEN(c,a4-4*hh1,a4-5*hh1),vv0,0);
c6:=if(BETWEEN(c,a4-5*hh1,a4-6*hh1),vv0,0);
c7:=if(BETWEEN(c,a4-6*hh1,a4-7*hh1),vv0,0);
c8:=if(BETWEEN(c,a4-7*hh1,a4-8*hh1),vv0,0);
c9:=if(BETWEEN(c,a4-8*hh1,a4-9*hh1),vv0,0);
c10:=if(BETWEEN(c,a4-9*hh1,a4-10*hh1),vv0,0);
v1:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c1,nn0),0),2));
v2:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c2,nn0),0),2));
v3:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c3,nn0),0),2));
v4:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c4,nn0),0),2));
v5:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c5,nn0),0),2));
v6:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c6,nn0),0),2));
v7:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c7,nn0),0),2));
v8:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c8,nn0),0),2));
v9:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c9,nn0),0),2));
v10:=STRTONUM(NUMTOSTR(if(ISLASTBAR,sum(c10,nn0),0),2));
av0:=max(v1,max(v2,max(v3,max(v4,max(v5,max(v6,max(v7,max(v8,max(v9,v10)))))))));
FILLRGN(v1/av0>=nn/nn0 and nn>=0,a4-0*hh1,a4-1*hh1+0.05),colorgray;
FILLRGN(v2/av0>=nn/nn0 and nn>=0,a4-1*hh1,a4-2*hh1+0.05),colorgray;
FILLRGN(v3/av0>=nn/nn0 and nn>=0,a4-2*hh1,a4-3*hh1+0.05),colorgray;
FILLRGN(v4/av0>=nn/nn0 and nn>=0,a4-3*hh1,a4-4*hh1+0.05),colorgray;
FILLRGN(v5/av0>=nn/nn0 and nn>=0,a4-4*hh1,a4-5*hh1+0.05),colorgray;
FILLRGN(v6/av0>=nn/nn0 and nn>=0,a4-5*hh1,a4-6*hh1+0.05),colorgray;
FILLRGN(v7/av0>=nn/nn0 and nn>=0,a4-6*hh1,a4-7*hh1+0.05),colorgray;
FILLRGN(v8/av0>=nn/nn0 and nn>=0,a4-7*hh1,a4-8*hh1+0.05),colorgray;
FILLRGN(v9/av0>=nn/nn0 and nn>=0,a4-8*hh1,a4-9*hh1+0.05),colorgray;
FILLRGN(v10/av0>=nn/nn0 and nn>=0,a4-9*hh1,a4-10*hh1+0.05),colorgray;

hh:=SYSPARAM(4);ll:=SYSPARAM(5);
x:=ll-(hh-ll+MINDIFF)/n;
y:=HHV(VOL,SYSPARAM(3)-SYSPARAM(2)+1);
yvb:=y[SYSPARAM(3)]/(ll-x+MINDIFF);
z:=VOL/yvb+x;
STICKLINE(CLOSE>REF(CLOSE,1),x,z,7,1),Color0000FF;
STICKLINE(CLOSE<=REF(CLOSE,1),x,z,7,0),ColorEAE000;
五日:MA(z,5),SHIFT5;
十日:MA(z,10),SHIFT5;


DRAWTEXT(BARPOS=SYSPARAM(2),HIGH,{STKNAME+'\n'+STKLABEL+'\n'+}BLKNAME)align4,COLORGREEN;


STICKLINE(C>=O,C,O,7,0),COLORRED;
STICKLINE(C>=O,C,O,4,0),COLORB0B0FF;
STICKLINE(C>=O,C,O,2,0),COLORYELLOW;
STICKLINE(C>=O,H,L,0,0),COLORYELLOW;
STICKLINE(C<=O,C,O,7,0),COLORFF2020;
STICKLINE(C<=O,C,O,4,0),COLORFF6600;
STICKLINE(C<=O,C,O,2,0),COLORCYAN;
STICKLINE(C<=O,H,L,0,0),COLORCYAN;


博弈线:=WMA(CLOSE,8),linethick3;
byx:=WMA(CLOSE,8),linethick3;
FILLRGN(byx>ref(byx,1),byx,ref(byx,1)),COLORRED;
FILLRGN(byxma21:ma(c,21),SHIFT5,color00ff00;


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,POINTDOT;
Var6:REFX(Var4,Var2),COLORWHITE,POINTDOT;  //主图最低价
黄191:(Var5-Var6)*0.191+Var6,COLORYELLOW,POINTDOT;
黄382:(Var5-Var6)*0.382+Var6,COLORYELLOW,POINTDOT;
黄500:(Var5-Var6)*0.500+Var6,COLORGREEN,POINTDOT;
黄618:(Var5-Var6)*0.618+Var6,COLORYELLOW,POINTDOT;
黄809:(Var5-Var6)*0.809+Var6,COLORYELLOW,POINTDOT;
A:=LOW=LLV(LOW,240);
A1:=BARSLAST(A);
VERTLINE(A1=30);
VERTLINE(A1=60);
VERTLINE(A1=90);
VERTLINE(A1=120);
VERTLINE(A1=150);
VERTLINE(A1=180);
VERTLINE(A1=210);
VERTLINE(A1=240);
DRAWTEXT(A1=30,HIGH,'第一时间');
DRAWTEXT(A1=60,HIGH,'第二时间');
DRAWTEXT(A1=90,HIGH,'第三时间');
DRAWTEXT(A1=120,HIGH,'第四时间');
DRAWTEXT(A1=150,HIGH,'第五时间');
DRAWTEXT(A1=180,HIGH,'第六时间');
DRAWTEXT(A1=210,HIGH,'第七时间');
DRAWTEXT(A1=240,HIGH,'第八时间');
Varr1:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),6,1)*100;
DRAWICON(CROSS(82,Varr1),HIGH+0.108,2);VERTLINE(CROSS(82,varr1)),POINTDOT;
DRAWSL(CROSS(82,varr1),HHV(HIGH,1),0,8,1),colormagenta,POINTDOT;
DRAWICON(COUNT(CROSS(Varr1,18),5) and CROSS(WMA(CLOSE,5),ref(WMA(CLOSE,5),1)),l-0.108,1);


b1:=(SYSPARAM(4)-SYSPARAM(5))/(SYSPARAM(3)-SYSPARAM(2));
DRAWSL(BARPOS=SYSPARAM(1),LOW,378*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,188*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,141*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,95*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,48*b1/100,0,0),COLORgreen,;
DRAWSL(BARPOS=SYSPARAM(1),LOW,24.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,16.5*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,13*b1/100,0,0),COLORwhite,POINTDOT;
DRAWSL(BARPOS=SYSPARAM(1),LOW,7*b1/100,0,0),COLORwhite,POINTDOT;
m1:=barslast(month<>ref(month,1));
w1:=barslast(weekdaywO:ref(O,w1),colorff00ff;//周开盘,
mO:ref(O,m1),colorwhite;//月开盘,


以今日收盘价向后画一条线

{3种写法,任选一句就可

STICKLINE(c<>0 and ISLASTBAR=1,c,c,1000,1);

drawsl(C<>0 AND ISLASTBAR,C,0,0,3),colorred;

PARTLINE(BACKSET(ISLASTBAR,30),DYNAINFO(7)),SHIFT30;

趋势线1
input:n(16),m(90);

drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
z:=zig(4,n);p:=SYSPARAM(1);
dd:="xh-z.dd"(n);  wd:=barslast(dd);  
sd:=sum(dd,0);  di:=sd[p]-sd+1;    id:=(digg:="xh-z.gg"(n);  wg:=barslast(gg);  
sg:=sum(gg,0);  gi:=sg[p]-sg+1;    ig:=(gitd0:=barslast(di[p]=id);
td1:=barslast(1+di[p]=id);
td2:=barslast(2+di[p]=id);
x:ref(z,td0),POINTDOT;
k1:(x-ref(z,td1))/ref(td1,td0)*100,LINETHICK0,COLORGREEN;
k3:(ref(z,td1)-ref(z,td2))/ref(td2,td1)*100,LINETHICK0,Color5E7159;
x1:x+td0*k1/100,LINETHICK0,COLORGREEN;
x2:ref(z,td1)+td1*k3/100,LINETHICK0,Color5E7159;
DRAWLINE(1+di[p]=id,z,di[p]=id,z,1),COLORGREEN;
DRAWLINE(2+di[p]=id,z,1+di[p]=id,z,1),Color5E7159,POINTDOT;
tg0:=barslast(gi[p]=ig);
tg1:=barslast(1+gi[p]=ig);
tg2:=barslast(2+gi[p]=ig);
s:ref(z,tg0),POINTDOT;
k2:(s-ref(z,tg1))/ref(tg1,tg0)*100,LINETHICK0,COLORMAGENTA;
k4:(ref(z,tg1)-ref(z,tg2))/ref(tg2,tg1)*100,LINETHICK0,Color546C82;
s1:s+tg0*k2/100,LINETHICK0,COLORMAGENTA;
s2:ref(z,tg1)+tg1*k4/100,LINETHICK0,Color546C82;
DRAWLINE(1+gi[p]=ig,z,gi[p]=ig,z,1),COLORMAGENTA;
DRAWLINE(2+gi[p]=ig,z,1+gi[p]=ig,z,1),Color546C82,POINTDOT;
DRAWICON((dd and di<5) or (gg and gi<5),z,12);
DRAWICON(di[p]=id or gi[p]=ig,z,10);

三点定乾坤

aad:=BACKSET(tjd,peakBARS(m,n,2));
ad:=aadbbd:=BACKSET(tjd,peakBARS(m,n,1));
bd:=bbdv2:=if(bd,1,0);
abd:LINEVALUE(ad,h,bd,h,0,0),linethick0;
kkad:=refx(abd,1)-abd;
DRAWSL(vv=abd and ad,h,kkad,la,0),colorgreen,linethick2;
ccd:=sum(abd>vv and ref(abd,1)=ref(abd,peakBARS(m,n,2));
cd:=ccd>ref(ccd,1);
bcd:=LINEVALUE(bd,h,cd,h,0,0),linethick0;
kkbd:=refx(bcd,1)-bcd;
DRAWSL(vv=abd and v2,h,kkbd,lb,0),COLORblue,linethick2;
DRAWSL(cd,h,0,lc,0),COLORWHITE,linethick2;
DRAWTEXT(vv=abd and ad,h*1.05,'A'),COLORWHITE;
DRAWTEXT(vv=abd and v2,h*1.05,'B'),COLORWHITE;
DRAWTEXT(cd,h*1.05,'C'),COLORWHITE;


上升(下降)通道

INPUT:N(240,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:=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:=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;


上升下降通道2

hh:=hhv(h,0);
hhh:=h;
aa:=BARSLAST(h=hh[datacount]);
ba:=datacount-aa;
ja:=1;
tm1:=999999;
for i1=ba[datacount]+1 to datacount do begin
    k1:=(hh[datacount]-hhh[i1])/ja;
  if k1    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,0);
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:=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;


速阻线

n=16
drawtext(sysparam(2)=barpos,c,'板块:'+blkname),colorccffff,align4;
dd:="xh-z.dd"(n);
gg:="xh-z.gg"(n);
z:=dd*L+gg*h;
gd:=gg+dd;
DRAWICON(dd,z,12);
p:=SYSPARAM(1);
sgd:=sum(gd,0);
gds:=sgd[p]-sgd+1;
sb:=if(gds<1,1,gds);
sa:=(sbhb:=hhv((sa=1)*BARPOS,0);
q:=hb[p];
wgd:=ref(barslast(gd),1)+1;
DRAWICON(gd,dd*L+gg*h,12);
hgd:=if(gg,h,if(dd,L,0));
Lgd:=if(gg,ref(L,wgd),if(dd,ref(h,wgd),0));
yhL:=(hgd-Lgd)/4;
oo:=CROSS(BACKSET(q=BARPOS,wgd[q]+1),0.5);{定点}
qz:=(wgd[q])*4/3;{画斜线1}
w:=sumbars(gd,2)-1;
K1:=(hgd[q]-Lgd[q])/qz*4/3,LINETHICK0;
d1:ref(z,w)+k1*w,LINETHICK0,ColorFF6FB7;
K2:=(hgd[q]-Lgd[q])/qz/1.123,LINETHICK0;
d2:ref(z,w)+k2*w,LINETHICK0,ColorFF6FB7;
K3:=(hgd[q]-Lgd[q])/qz/2.246,LINETHICK0;
d3:ref(z,w)+k3*w,LINETHICK0,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k1,0,0),LINETHICK1,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k2,0,0),POINTDOT,ColorFF6FB7;
DRAWSL(oo,Lgd[q],k3,0,0),POINTDOT,ColorFF6FB7;


{画斜线2}

b1:=(Lgd[q]-hgd[q])/qz*4/3,LINETHICK0;
g1:ref(hgd[q],w)+b1*w,LINETHICK0,Color74AFFF;
b2:=(Lgd[q]-hgd[q])/qz/1.132,LINETHICK0;
g2:ref(hgd[q],w)+b2*w,LINETHICK0,Color74AFFF;
b3:=(Lgd[q]-hgd[q])/qz/2.246,LINETHICK0;
g3:ref(hgd[q],w)+b3*w,LINETHICK0,Color74AFFF;
DRAWSL(oo,hgd[q],b1,0,0),Color74AFFF,LINETHICK1;
DRAWSL(oo,hgd[q],b2,0,0),POINTDOT,Color74AFFF;
DRAWSL(oo,hgd[q],b3,0,0),POINTDOT,Color74AFFF;
i1:='斜率\nk1\n'+'±'+NUMTOSTR(abs(k1)*100,3)+'\nk2\n'+'±'
+NUMTOSTR(abs(k2)*100,3)+'\nk3\n'+'±'+NUMTOSTR(abs(k3)*100,3);
DRAWTEXT(BARPOS=SYSPARAM(3)-3,h,i1),ALIGN4,SHIFT1,Color74AFFF;


前几日有涨停收盘,今日涨幅大于3%


w:=barslast(ref(c,1)*1.1-c<0.01);
DRAWLINE(w=0,c,c/ref(c,1)>1.03,c,0);
DRAWLINE(w=0,o,c/ref(c,1)>1.03,o,0);


1:今天收盘前的某一天有一涨停板;
2:今天收盘涨幅大于3%;
在涨停板的开盘价和今天的开盘价处画连线
在涨停板的收盘价和今天的收盘价处画连线

趋势线2


gz1:=PEAKBARS(1,10,1);
gg1:=BACKSET(ISLASTBAR,gz1+1);
gz2:=PEAKBARS(1,5,2);
gg2:=BACKSET(ISLASTBAR,gz2+1);
dz1:=TROUGHBARS(2,10,1);
dz3:=TROUGHBARS(2,10,2);
dz7:=TROUGHBARS(2,5,2);
dg1:=BACKSET(ISLASTBAR,dz1+1);
dg4:=BACKSET(ISLASTBAR,dz3+1);
dg8:=BACKSET(ISLASTBAR,dz7+1);

MACD背离画线

DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
STICKLINE(低位金叉,0,0.3,8,0),COLORYELLOW;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,0.2,8,0),COLORff80ff;
DRAWICON(二次金叉,dea*0.9,1) ;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
STICKLINE(底背离,0,0.1,8,0),COLORRED;
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,linethick2;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,linethick2;


支撑'压力

DRAWICON(((CLOSE > 0) AND (ISLASTBAR = 1)),CLOSE,'一休哥1'),ALIGN4,SHIFT2;
VAR1:=(EMA(VOL,12) - EMA(VOL,26));
VAR2:=EMA(VAR1,9);
VAR3:=(((EMA(CLOSE,30) * 2) + MA(CLOSE,60)) / 3);
A3:=(((EMA(CLOSE,10) * 2) + MA(CLOSE,20)) / 3);
VAR4:=(VOL * CLOSE);
VAR5:=(EMA(VAR4,13) / EMA(VOL,13));
VAR6:=(EMA(VAR4,60) / EMA(VOL,60));
VAR7:=EMA(((VAR5 + VAR6) / 2),3);
A5:=(EMA(VAR4,5) / EMA(VOL,5));
A6:=(EMA(VAR4,20) / EMA(VOL,20));
A7:=EMA(((A5 + A6) / 2),3);
A:=MA(((A3 + A7) / 2),1);
A1:=REF(A,1);
A8:=MA(((VAR3 + VAR7) / 2),1);
A22:=MA(((VAR3 + VAR7) / 2),1);
【中线强弱线】:A22,LINETHICK0,colorFF;
DRAWICON((A8 < REF(A8,1)),REF(A8,2),11),LINETHICK2,colorFFFFFF;
DRAWICON((A8 >= REF(A8,1)),REF(A8,2),10),LINETHICK2,colorFF;
VAR11:=(((((2 * CLOSE) + OPEN) + HIGH) + LOW) / 5);
VAR12:=VOL;
【短期强弱线】:(SUM((VAR11 * VAR12),13) / SUM(VAR12,13)),LINETHICK1,colorFFFF;
PARTLINE((【短期强弱线】 > REF(【短期强弱线】,1)),【短期强弱线】),colorFF00FF;
AM:=DMA(MA(DMA(CLOSE,VAR2),6),(VOL / SUM(VOL,89)));
【牛熊线】:AM,LINETHICK2,color9900;
VARA:=IF((CLOSE > 150),91.3,0.913);
【下沿】:=(INTPART((CLOSE / VARA)) * VARA);
【上沿】:=(【下沿】 + VARA);
【中线】:=((【下沿】 + 【上沿】) / 2);
STICKLINE(((((SYSPARAM(1) = BARPOS) AND 【下沿】) AND (CLOSE > 【下沿】)) AND (CLOSE < 【中线】)),【下沿】,【下沿】,50,0),LINETHICK3,colorFF9900;
STICKLINE(((((SYSPARAM(1) = BARPOS) AND 【上沿】) AND (CLOSE < 【上沿】)) AND (CLOSE > 【中线】)),【上沿】,【上沿】,50,0),LINETHICK3,color99FF;
STICKLINE(((SYSPARAM(1) = BARPOS) AND 【中线】),【中线】,【中线】,50,0),LINETHICK3,colorFFFFFF;
【蓝色】:【下沿】,LINETHICK0,colorFF9900;
【棕色】:【上沿】,LINETHICK0,color99FF;
【白色】:【中线】,LINETHICK0,colorFFFFFF;
DRAWTEXT(((((SYSPARAM(1) = BARPOS) AND 【下沿】) AND (CLOSE > 【下沿】)) AND (CLOSE < 【中线】)),【下沿】,'支撑'),SHIFT3,colorFF00;
DRAWTEXT(((((SYSPARAM(1) = BARPOS) AND 【下沿】) AND (CLOSE > 【下沿】)) AND (CLOSE < 【中线】)),【中线】,'压力'),SHIFT3,colorFF;
DRAWTEXT(((((SYSPARAM(1) = BARPOS) AND 【上沿】) AND (CLOSE < 【上沿】)) AND (CLOSE > 【中线】)),【上沿】,'压力'),SHIFT3,colorFF;
DRAWTEXT(((((SYSPARAM(1) = BARPOS) AND 【上沿】) AND (CLOSE < 【上沿】)) AND (CLOSE > 【中线】)),【中线】,'支撑'),SHIFT3,colorFF00;

黄金八分

input:n(1400,1,9999),m(700,1,9999);
Var1:LLV(LOW,5000),colorblue;
Var2:HHV(HIGH,5000),colorblue;
L382:LLV(LOW,5000)*1.382,colorblue;
L618:LLV(LOW,5000)*1.618,colorblue;
H382:HHV(HIGH,5000)*0.382,colorblue;
H618:HHV(HIGH,5000)*0.618,colorblue;
HL382:(Var2-Var1)*0.382+Var1,colorbrown;
HL618:(Var2-Var1)*0.618+Var1,colorred;
HL33:(Var2-Var1)*0.33+Var1,colorbrown;
HL66:(Var2-Var1)*0.66+Var1,colorred;

VERTLINE(FILTER(BACKSET(ISLASTBAR,N),N-1)),COLORRED;
VERTLINE(FILTER(BACKSET(ISLASTBAR,M),M-1)),COLORRED;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8),N-(N-M)/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*2),N-(N-M)/8*2-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*3),N-(N-M)/8*3-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*4),N-(N-M)/8*4-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*5),N-(N-M)/8*5-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*6),N-(N-M)/8*6-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*7),N-(N-M)/8*7-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)/8*8),N-(N-M)/8*8-1)),COLORRED;

VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*9/8),N-(N-M)*9/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*10/8),N-(N-M)*10/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*9/8),N-(N-M)*9/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*10/8),N-(N-M)*10/8-1)),COLORYELLOW;

VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*11/8),N-(N-M)*11/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*12/8),N-(N-M)*12/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*13/8),N-(N-M)*13/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*14/8),N-(N-M)*14/8-1)),COLORYELLOW;

VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*15/8),N-(N-M)*15/8-1)),COLORYELLOW;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*16/8),N-(N-M)*16/8-1)),COLORYELLOW;

VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*2/3),N-(N-M)*2/3-1)),COLORWHITE;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*4/3),N-(N-M)*4/3-1)),COLORWHITE;
VERTLINE(FILTER(BACKSET(ISLASTBAR,N-(N-M)*5/3),N-(N-M)*5/3-1)),COLORWHITE;


黄金牛线

input:var1(5,1,10000);

N: 1*Var1;
1.073*Var1, POINTDOT;
1.118*Var1, POINTDOT;
N1: 1.191*Var1;
1.264*Var1, POINTDOT;
1.309*Var1, POINTDOT;
N3: 1.382*Var1;
1.472*Var1, POINTDOT;
1.528*Var1, POINTDOT;
N4: 1.618*Var1;
1.691*Var1, POINTDOT;
疯牛: 1.809*Var1;


黄金切割率

N:=SYSPARAM(3)-SYSPARAM(2);
A:=BACKSET(ISLASTBAR,HHVBARS(H,N)+1);
B:=COUNT(A,N)=1;
前高:REF(H,BARSLAST(B)),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前高,前高,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前高,'(前高)'),SHIFT7,COLORWHITE;
A2:=BACKSET(ISLASTBAR,LLVBARS(L,N)+1);
B2:=A2>REF(A2,1);
前低:REF(L,BARSLAST(B2)),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前低,前低,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前低,'(前低)'),SHIFT7,COLORWHITE;
F1:((前高-前低)*0.236)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F1,F1,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F1,'(0.236)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F2:((前高-前低)*0.382)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F2,F2,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F2,'(0.382)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F3:((前高-前低)*0.5)+前低,COLORFFFF00;
DRAWNUMBER(ISLASTBAR,F3,F3,2),aligno5,SHIFT3,COLORFFFF00;
DRAWTEXT(ISLASTBAR,F3,'(0.5)'),SHIFT7,COLORWHITE;
F4:((前高-前低)*0.618)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F4,F4,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F4,'(0.618)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F5:((前高-前低)*0.764)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F5,F5,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F5,'(0.764)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)

黄金切割率-1


N:=SYSPARAM(3)-SYSPARAM(1);
A:=BACKSET(ISLASTBAR,HHVBARS(H,N)+1);
B:=COUNT(A,N)=1;
前高:IF(N>0,REF(H,BARSLAST(B)),0),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前高,前高,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前高,'(前高)'),SHIFT7,COLORWHITE;
A2:=BACKSET(ISLASTBAR,LLVBARS(L,N)+1);
B2:=A2>REF(A2,1);
前低:REF(L,BARSLAST(B2)),COLORWHITE;
DRAWNUMBER(ISLASTBAR,前低,前低,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前低,'(前低)'),SHIFT7,COLORWHITE;
F1:((前高-前低)*0.236)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F1,F1,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F1,'(0.236)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F2:((前高-前低)*0.382)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F2,F2,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F2,'(0.382)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F3:((前高-前低)*0.5)+前低,COLORFFFF00;
DRAWNUMBER(ISLASTBAR,F3,F3,2),aligno5,SHIFT3,COLORFFFF00;
DRAWTEXT(ISLASTBAR,F3,'(0.5)'),SHIFT7,COLORWHITE;
F4:((前高-前低)*0.618)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F4,F4,2),aligno5,SHIFT3,COLORFF00FF;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F4,'(0.618)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)F5:((前高-前低)*0.764)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F5,F5,2),aligno5,SHIFT3,COLORYELLOW;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and ISLASTBAR,F5,'(0.764)'),SHIFT7,COLORWHITE;
DRAWTEXT(BARSLAST(B)

黄金切割率-2



前高:SYSPARAM(4),colorwhite;
DRAWNUMBER(ISLASTBAR,前高,前高,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前高,'(前高)'),SHIFT7,COLORWHITE;
前低:SYSPARAM(5),colorwhite;
DRAWNUMBER(ISLASTBAR,前低,前低,2),aligno5,SHIFT3,COLORWHITE;
DRAWTEXT(ISLASTBAR,前低,'(前低)'),SHIFT7,COLORWHITE;
F1:((前高-前低)*0.236)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F1,F1,2),aligno5,SHIFT3,COLORYELLOW;
F2:((前高-前低)*0.382)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F2,F2,2),aligno5,SHIFT3,COLORFF00FF;
F3:((前高-前低)*0.5)+前低,COLORFFFF00;
DRAWNUMBER(ISLASTBAR,F3,F3,2),aligno5,SHIFT3,COLORFFFF00;
F4:((前高-前低)*0.618)+前低,COLORFF00FF;
DRAWNUMBER(ISLASTBAR,F4,F4,2),aligno5,SHIFT3,COLORFF00FF;
F5:((前高-前低)*0.764)+前低,COLORYELLOW;
DRAWNUMBER(ISLASTBAR,F5,F5,2),aligno5,SHIFT3,COLORYELLOW;


黄金上升


input:n(999,1,10000),p1(1,1,1000);

HH:=HHV(H,N)COLORWHITE;
LL:LLV(L,N)COLORWHITE;
<%
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
%>

TJ:=BARSCOUNT(LL)=N-(N-p1);

DRAWTEXT(ISLASTBAR,LL,'      0↑');
DRAWNUMBER(TJ,LL,LL,2),ALIGN2;

M1:LL*1.0625,COLORYELLOW;
DRAWTEXT(ISLASTBAR,M1,'  6.25%↑ 22.5')COLORYELLOW;
DRAWNUMBER(TJ,M1,M1,2),ALIGN2,COLORYELLOW;
M2:LL*1.125,COLORRED;
DRAWTEXT(c>0  and ISLASTBAR=1,M2,'  12.5%↑   45')COLORRED;
DRAWNUMBER(TJ,M2,M2,2),ALIGN2,COLORRED;
M3:LL*1.1875,COLORGREEN;
DRAWTEXT(ISLASTBAR,M3,' 18.75%↑ 67.5')COLORGREEN;
DRAWNUMBER(TJ,M3,M3,2)ALIGN2,COLORGREEN;
M4:LL*1.25,COLORCYAN;
DRAWTEXT(c>0  and ISLASTBAR=1,M4,'    25%↑   90')COLORCYAN;
DRAWNUMBER(TJ,M4,M4,2),ALIGN2,COLORCYAN;
M5:LL*1.3125,COLOR00808000;
DRAWTEXT(c>0  and ISLASTBAR=1,M5,' 31.25%↑112.5')COLOR00808000;
DRAWNUMBER(TJ,M5,M5,2)ALIGN2,COLOR00808000;
M6:LL*1.3333,COLORMAGENTA;
DRAWTEXT(c>0  and ISLASTBAR=1,M6,'  33.3%↑  120')COLORMAGENTA;
DRAWNUMBER(TJ,M6,M6,2),ALIGN2,COLORMAGENTA;
M7:LL*1.375,COLORGRAY;
DRAWTEXT(c>0  and ISLASTBAR=1,M7,'  37.5%↑  135')COLORGRAY;
DRAWNUMBER(TJ,M7,M7,2),ALIGN2,COLORGRAY;
M8:LL*1.4375,COLORBLUE;
DRAWTEXT(c>0  and ISLASTBAR=1,M8,' 43.75%↑157.5')COLORBLUE;
DRAWNUMBER(TJ,M8,M8,2)ALIGN2,COLORBLUE;
M9:LL*1.5,COLORYELLOW;
DRAWTEXT(c>0  and ISLASTBAR=1,M9,'    50%↑  180')COLORYELLOW;
DRAWNUMBER(TJ,M9,M9,2),ALIGN2,COLORYELLOW;

M10:LL*1.5625,COLORRED;
DRAWTEXT(c>0  and ISLASTBAR=1,M10,' 56.25%↑202.5')COLORRED;
DRAWNUMBER(TJ,M10,M10,2),ALIGN2,COLORRED;
M11:LL*1.625,COLORGREEN;
DRAWTEXT(c>0  and ISLASTBAR=1,M11,'  62.5%↑  225')COLORGREEN;
DRAWNUMBER(TJ,M11,M11,2),ALIGN2,COLORGREEN;
M12:LL*1.6667,COLOR00808000;
DRAWTEXT(c>0  and ISLASTBAR=1,M12,'  66.6%↑  240')COLOR00808000;
DRAWNUMBER(TJ,M12,M12,2),ALIGN2,COLOR00808000;
M13:LL*1.6875,COLORMAGENTA;
DRAWTEXT(c>0  and ISLASTBAR=1,M13,' 68.75%↑247.5')COLORMAGENTA;
DRAWNUMBER(TJ,M13,M13,2),ALIGN2,COLORMAGENTA;
M14:LL*1.75,COLORGRAY;
DRAWTEXT(c>0  and ISLASTBAR=1,M14,'    75%↑  270')COLORGRAY;
DRAWNUMBER(TJ,M14,M14,2),ALIGN2,COLORGRAY;
M15:LL*1.8125,COLORBLUE;
DRAWTEXT(c>0  and ISLASTBAR=1,M15,' 81.25%↑292.5')COLORBLUE;
DRAWNUMBER(TJ,M15,M15,2),ALIGN2,COLORBLUE;
M16:LL*1.875,COLORYELLOW;
DRAWTEXT(c>0  and ISLASTBAR=1,M16,'  87.5%↑  315')COLORYELLOW;
DRAWNUMBER(TJ,M16,M16,2),ALIGN2,COLORYELLOW;
M17:LL*1.9375,COLORRED;
DRAWTEXT(c>0  and ISLASTBAR=1,M17,' 93.75%↑337.5')COLORRED;
DRAWNUMBER(TJ,M17,M17,2),ALIGN2,COLORRED;
M18:LL*2,COLORGREEN;
DRAWTEXT(c>0  and ISLASTBAR=1,M18,'   100%↑  360')COLORGREEN;
DRAWNUMBER(TJ,M18,M18,2),ALIGN2,COLORGREEN;
M19:LL*2.0625,COLORCYAN;
DRAWTEXT(c>0  and ISLASTBAR=1,M19,'106.25%↑382.5')COLORCYAN;
DRAWNUMBER(TJ,M19,M19,2),ALIGN2,COLORCYAN;
M20:LL*2.125,COLOR00808000;
DRAWTEXT(c>0  and ISLASTBAR=1,M20,' 112.5%↑  405')COLOR00808000;
DRAWNUMBER(TJ,M20,M20,2),ALIGN2,COLOR00808000;


黄金下降


input:n(999,1,10000),p(1,1,100);

HH:HHV(H,N)COLORWHITE;
LL:=LLV(L,N)COLORWHITE;
<%
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
%>

TJ:=BARSCOUNT(HH)=N-(N-p);

DRAWTEXT(ISLASTBAR,HH,'      0↓'),COLORWHITE;
DRAWNUMBER(TJ,HH,HH,2),ALIGN2,COLORWHITE;


M1:HH*0.9375,COLORYELLOW;
DRAWTEXT(c>0  and ISLASTBAR=1,M1,'  6.25%↓ 22.5')COLORYELLOW;
DRAWNUMBER(TJ,M1,M1,2),ALIGN2,COLORYELLOW;
M2:HH*0.875,COLORRED;
DRAWTEXT(c>0  and ISLASTBAR=1,M2,'  12.5%↓   45')COLORRED;
DRAWNUMBER(TJ,M2,M2,2),ALIGN2,COLORRED;
M3:HH*0.8125,COLORGREEN;
DRAWTEXT(c>0  and ISLASTBAR=1,M3,' 18.75%↓ 67.5')COLORGREEN;
DRAWNUMBER(TJ,M3,M3,2),ALIGN2,COLORGREEN;
M4:HH*0.75,COLORCYAN;
DRAWTEXT(c>0  and ISLASTBAR=1,M4,'    25%↓   90')COLORCYAN;
DRAWNUMBER(TJ,M4,M4,2),ALIGN2,COLORCYAN;
M5:HH*0.6875,COLORMAGENTA;
DRAWTEXT(c>0  and ISLASTBAR=1,M5,' 31.25%↓112.5')COLORMAGENTA;
DRAWNUMBER(TJ,M5,M5,2),ALIGN2,COLORMAGENTA;
M6:HH*0.6667,COLOR000094D0;
DRAWTEXT(c>0  and ISLASTBAR=1,M6,'  33.3%↓  120')COLOR000094D0;
DRAWNUMBER(TJ,M6,M6,2),ALIGN2,COLOR000094D0;
M7:HH*0.625,COLORBLUE;
DRAWTEXT(c>0  and ISLASTBAR=1,M7,'  37.5%↓  135')COLORBLUE;
DRAWNUMBER(TJ,M7,M7,2),ALIGN2,COLORBLUE;
M8:HH*0.5625,COLORGRAY;
DRAWTEXT(c>0  and ISLASTBAR=1,M8,' 43.75%↓157.5')COLORGRAY;
DRAWNUMBER(TJ,M8,M8,2),ALIGN2,COLORGRAY;
M9:HH*0.5,colorFF00CC;
DRAWTEXT(c>0  and ISLASTBAR=1,M9,'    50%↓  180')colorFF00CC;
DRAWNUMBER(TJ,M9,M9,2),ALIGN2,,colorFF00CC;


黄金熊线

input:var1(5,1,1000);

X: 1*Var1;
0.927*Var1, POINTDOT;
0.882*Var1, POINTDOT;
X1: 0.809*Var1;
0.736*Var1, POINTDOT;
0.691*Var1, POINTDOT;
X2: 0.618*Var1;
0.528*Var1, POINTDOT;
0.472*Var1, POINTDOT;
呆熊: 0.382*Var1;


动态画线

input:N(3);
J1:=IsLastBar;
J2:=REF(HIGH,N)=HHV(HIGH,2*N+1);
J3:=FILTER(J2,N);
J4:=BACKSET(J3,N+1);
J5:=FILTER(J4,N);
J6:=J5 OR J1;
J7:=REF(LOW,N)=LLV(LOW,2*N+1);
J8:=FILTER(J7,N);
J9:=BACKSET(J8,N+1);
JA:=FILTER(J9,N);
JB:=JA AND NOT(J5);
JC:=BACKSET(J6,REF(BARSLAST(JB),1)+1);
JD:=JC>REF(JC,1);
JE:=BACKSET(JD,2);
JF:=JE>REF(JE,1);
J10:=BACKSET(JF AND COUNT(J6,REF(BARSLAST(JB),1)+2)=0,REF(BARSLAST(JB),1)+2);
J11:=J10>REF(J10,1);
J12:=BACKSET(J11 AND COUNT(J6,REF(BARSLAST(JB),1)+2)=0,REF(BARSLAST(JB),1)+2);
J13:=J12>REF(J12,1);
J14:=IF(J6,COUNT(JB,REF(BARSLAST(J6),1)+1),0);
J15:=IF(J14=1 AND J6,BARSLAST(JF),0);
J16:=IF(J6 AND REF(LOW,BARSLAST(JF))>=REF(LOW,BARSLAST(J11)),BARSLAST(J11),BARSLAST(JF));
J17:=IF(J14=2 AND J6,J16,0);
J18:=IF(J14>=3 AND J6,IF(J6 AND REF(LOW,J16)>=REF(LOW,BARSLAST(J13)),BARSLAST(J13),J16),0);
J19:=J15+J17+J18;
J1A:=BACKSET(J6,J19);
J1B:=J1A>REF(J1A,1);
J1C:=BACKSET(J1B,2);
J1D:=J1C>REF(J1C,1);
J1E:=J1D OR J1;
J1F:=BACKSET(J1E,REF(BARSLAST(J6),1)+1);
J20:=J1F>REF(J1F,1);
J21:=BACKSET(J20,2);
J22:=J21>REF(J21,1);
J23:=BACKSET(J22 AND COUNT(J1E,REF(BARSLAST(J6),1)+2)=0,REF(BARSLAST(J6),1)+2);
J24:=J23>REF(J23,1);
J25:=BACKSET(J24 AND COUNT(J1E,REF(BARSLAST(J6),1)+2)=0,REF(BARSLAST(J6),1)+2);
J26:=J25>REF(J25,1);
J27:=IF(J1E,COUNT(J5,REF(BARSLAST(J1E),1)+1),0);
J28:=IF(J27=1 AND J1E,BARSLAST(J22),0);
J29:=IF(J1E AND REF(HIGH,BARSLAST(J22))<=REF(HIGH,BARSLAST(J24)),BARSLAST(J24),BARSLAST(J22));
J2A:=IF(J27=2 AND J1E,J29,0);
J2B:=IF(J27>=3 AND J1E,IF(J1E AND REF(HIGH,J29)<=REF(HIGH,BARSLAST(J26)),BARSLAST(J26),J29),0);
J2C:=J28+J2A+J2B;
J2D:=BACKSET(J1E,J2C);
J2E:=J2D>REF(J2D,1);
J2F:=BACKSET(J2E,2);
J30:=J2F>REF(J2F,1);
J37:=BACKSET(J1,BARSLAST(J1D)+1);
J38:=J37>REF(J37,1);
J39:=BACKSET(J38,REF(BARSLAST(J1D),1)+2);
J3A:=J39>REF(J39,1);
J3B:=BACKSET(J1,BARSLAST(J30)+1);
J3C:=J3B>REF(J3B,1);
J3D:=BACKSET(J3C,REF(BARSLAST(J30),1)+2);
J3E:=J3D>REF(J3D,1),Coloryellow,PointDot;
DRAWLINE(J3A,LOW,J38,LOW,1),Coloryellow,PointDot;
DRAWLINE(J3E,HIGH,J3C,HIGH,1),Coloryellow,PointDot;
前一低: REF(LOW,BARSLAST(J38)),Colorcyan,PointDot,Linethick3;
前二低: REF(LOW,BARSLAST(J3A)),Colormagenta,PointDot,Linethick2;
前一高: REF(HIGH,BARSLAST(J3C)),Colorcyan,PointDot,Linethick3;
前二高: REF(HIGH,BARSLAST(J3E)),Colormagenta,PointDot,Linethick2;

百分比等比坐标线(需激活十字光标后使用)

ll:=sysparam(5);

hh:=sysparam(4);

n:=round(ln(hh/ll)/ln(1.1)+0.5);

variable:zb[n]=ll;

for i=2 to n do
  zb:=zb[i-1]*1.1;

zb[1],color008888,pointdot;

if n>=02 then zb[02],color008888,pointdot;

if n>=03 then zb[03],color008888,pointdot;

if n>=04 then zb[04],color008888,pointdot;

if n>=05 then zb[05],color008888,pointdot;

if n>=06 then zb[06],color008888,pointdot;

if n>=07 then zb[07],color008888,pointdot;

if n>=08 then zb[08],color008888,pointdot;

if n>=09 then zb[09],color008888,pointdot;

if n>=10 then zb[10],color008888,pointdot;

if n>=11 then zb[11],color008888,pointdot;

if n>=12 then zb[12],color008888,pointdot;

if n>=13 then zb[13],color008888,pointdot;

if n>=14 then zb[14],color008888,pointdot;

if n>=15 then zb[15],color008888,pointdot;

if n>=16 then zb[16],color008888,pointdot;

if n>=17 then zb[17],color008888,pointdot;

if n>=18 then zb[18],color008888,pointdot;

if n>=19 then zb[19],color008888,pointdot;

if n>=20 then zb[20],color008888,pointdot;

if n>=21 then zb[21],color008888,pointdot;

if n>=22 then zb[22],color008888,pointdot;

if n>=23 then zb[23],color008888,pointdot;

if n>=24 then zb[24],color008888,pointdot;

if n>=25 then zb[25],color008888,pointdot;

if n>=26 then zb[26],color008888,pointdot;

if n>=27 then zb[27],color008888,pointdot;

if n>=28 then zb[28],color008888,pointdot;

if n>=29 then zb[29],color008888,pointdot;

if n>=30 then zb[30],color008888,pointdot;

if n>=31 then zb[31],color008888,pointdot;

if n>=32 then zb[32],color008888,pointdot;

if n>=33 then zb[33],color008888,pointdot;

if n>=34 then zb[34],color008888,pointdot;

if n>=35 then zb[35],color008888,pointdot;

if n>=36 then zb[36],color008888,pointdot;

if n>=37 then zb[37],color008888,pointdot;

if n>=38 then zb[38],color008888,pointdot;

if n>=39 then zb[39],color008888,pointdot;

if n>=40 then zb[40],color008888,pointdot;

if n>=41 then zb[41],color008888,pointdot;

if n>=42 then zb[42],color008888,pointdot;

if n>=43 then zb[43],color008888,pointdot;

if n>=44 then zb[44],color008888,pointdot;

if n>=45 then zb[45],color008888,pointdot;

if n>=46 then zb[46],color008888,pointdot;

if n>=47 then zb[47],color008888,pointdot;

if n>=48 then zb[48],color008888,pointdot;

if n>=49 then zb[49],color008888,pointdot;

if n>=50 then zb[50],color008888,pointdot;


黄金分割

D:=SYSParam( 4 ) ;
DD:=SYSParam( 4 ) / 2 ;
EE:=Sum(1,0)=SYSParam( 3 );

顶点:D - 0*DD , LineThick0 , Color80FFFF ;
XA:=D - 0.073*DD ;
YA:=D - 0.118*DD ;
DrawLine( D=H , 顶点 , EE=1 , 顶点 , 1 ) , Color80FFFF ;
DrawLine( D=H , XA , EE=1 , XA ,1 ) , PointDot , ColorEFC8A0 ;
DrawLine( D=H , YA , EE=1 , YA , 1 ) , PointDot , ColorEFC8A0 ;

浪花:D - 0.191*DD , LineThick0 , Color6F9DFF ;
XB:=D - 0.264*DD ;
YB:=D - 0.309*DD ;
DrawLine( D=H , 浪花 , EE=1 , 浪花 , 1 ) , Color6F9DFF ;
DrawLine( D=H , XB , EE=1 , XB ,1 ) , PointDot , ColorEFC8A0 ;
DrawLine( D=H , YB , EE=1 , YB , 1 ) , PointDot , ColorEFC8A0 ;

熊口:D - 0.382*DD , LineThick0 , ColorFF8080 ;
XC:=D - 0.472*DD ;
YC:=D - 0.528*DD ;
DrawLine( D=H , 熊口 , EE=1 , 熊口 , 1 ) , ColorFF8080 ;
DrawLine( D=H , XC , EE=1 , XC ,1 ) , PointDot , ColorEFC8A0 ;
DrawLine( D=H , YC , EE=1 , YC , 1 ) , PointDot , ColorEFC8A0 ;

熊洞:D - 0.618*DD , LineThick0 , ColorC080FF ;
XD:=D - 0.691*DD ;
YD:=D - 0.736*DD ;
DrawLine( D=H ,熊洞 , EE=1 , 熊洞 , 1 ) , ColorC080FF ;
DrawLine( D=H , XD , EE=1 , XD ,1 ) , PointDot , ColorEFC8A0 ;
DrawLine( D=H , YD , EE=1 , YD , 1 ) , PointDot , ColorEFC8A0 ;

熊眠:D - 0.809*DD , LineThick0 , ColorFFFFFF ;
DrawLine( D=H , 熊眠 , EE=1 , 熊眠 , 1 ) , ColorFFFFFF ;

熊底:D - 1*DD , LineThick0 , Color80F906 ;
DrawLine( D=H , 熊底 , EE=1 , 熊底 , 1 ) , Color80F906 ;

熊谷:D - 1.382*DD , LineThick0 , Color80F906 ;
DrawLine( D=H , 熊谷 , EE=1 , 熊谷 , 1 ) , Color80F906 ;


自动回归线

A1:=EMA(C,3);
A2:=EMA(C,5);
A3:IF(A1>=A2,A1,A2);DRAWNUMBER(ISLASTBAR=1,A3,A3,1),SHIFT1;
PARTLINE(A1>A2,A3),LINETHICK2,COLORMAGENTA;
PARTLINE(A1PARTLINE(A1=A2,A3),LINETHICK2,COLORyellow;
DataCountN:=c*0;
<%
nn=FFL.VarData("DataCountN")
setnn=ubound(nn)+1
for i = lbound(nn) to ubound(nn)
  nn(i)=setnn
next
FFL.VarData("DataCountN")=nn
%>
p:=if(SYSPARAM(1)Ax:=p=BarsCount(c);
Ay:=refx(forcast(c,t),t)-refx(slope(c,t),t)*t;
Bx:=ref(Ax,t);
By:=forcast(c,t);
中值:LINEvalue(Ax,Ay,Bx,By,0,0),COLORCYAN,LINETHICK2;
js:=hhv(h-中值,t+1);
jq:=hhv(中值-L,t+1);
upos:=p+t;
<%
upos=FFL.VarData("upos")
js=FFL.VarData("js")
jq=FFL.VarData("jq")
for i = lbound(js) to ubound(js)
  js(i)=js(upos(i)-1)
  jq(i)=jq(upos(i)-1)
next
FFL.VarData("js")=js
FFL.VarData("jq")=jq
%>
上轨:LINEvalue(Ax,Ay+js,Bx,By+js,0,0),COLORRED,LINETHICK2;
下轨:LINEvalue(Ax,Ay-jq,Bx,By-jq,0,0),COLORGREEN,LINETHICK2;
STICKLINE(Ax or Bx,上轨,下轨,0.01,0)COLORGRAY,POINTDOT;

DataCountN1:=c*0;
<%
nn=FFL.VarData("DataCountN1")
setnn=ubound(nn)+1
for i = lbound(nn) to ubound(nn)
  nn(i)=setnn
next
FFL.VarData("DataCountN1")=nn
%>
p1:=if(SYSPARAM(1)Ax1:=p1=BarsCount(c);
Ay1:=refx(forcast(c,t1),t1)-refx(slope(c,t1),t1)*t1;
Bx1:=ref(Ax1,t1);
By1:=forcast(c,t1);
大中值1:LINEvalue(Ax1,Ay1,Bx1,By1,0,0),COLORCYAN,LINETHICK2;
js1:=hhv(h-大中值1,t1+1);
jq1:=hhv(大中值1-L,t1+1);
upos1:=p1+t1;
<%
upos1=FFL.VarData("upos1")
js1=FFL.VarData("js1")
jq1=FFL.VarData("jq1")
for i = lbound(js1) to ubound(js1)
  js1(i)=js1(upos1(i)-1)
  jq1(i)=jq1(upos1(i)-1)
next
FFL.VarData("js1")=js1
FFL.VarData("jq1")=jq1
%>
大上轨1:LINEvalue(Ax1,Ay1+js1,Bx1,By1+js1,0,0),COLORRED,LINETHICK2;
大下轨1:LINEvalue(Ax1,Ay1-jq1,Bx1,By1-jq1,0,0),COLORGREEN,LINETHICK2;
STICKLINE(Ax1 or Bx1,大上轨1,大下轨1,0.01,0)COLORGRAY,POINTDOT;