注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

196898jiabeizan的博客

股道 股之道 赌之道 惑之道 非常道 孟子曰 盛极而衰 否极泰来 股之正道也 妖

 
 
 

日志

 
 

用的都是画线法  

2009-04-22 10:44:57|  分类: 画线 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

画线(注:功能只在选择K线功能的时候才会显示)

当您点击此项功能的时候,在屏幕上将出现下图对话框:

 

 

 

1.   直线:

使用方法是按下鼠标选取直线的起点,然后移动鼠标(注意不要松开鼠标)直到直线的终点,松开鼠标即可。

2.  平行线:

使用方法是按照画直线的方法先画一条直线,然后移动鼠标,此时有一根平行的虚线始终跟随鼠标,移动该线到你想要的位置,然后点击鼠标。

3.  栅形线:

使用方法和平行线类似。

4.  通道线:

使用方法是选取您想要画通道的起始位置,用鼠标拉出一个范围,然后松开鼠标即可。

5.  箱体线:

使用方法和通道线类似。

6.  黄金分割线:

使用方法和通道线类似。

7.  周期线:

使用方法是选取周期的起始天,按住鼠标到周期的结束日后松开鼠标即可。

8.  神秘数字线:

使用方法是点取神秘数字的起始天就可以了。

9.  经典江恩线:

使用方法和通道线类似。

10. CY江恩线:

使用方法和经典江恩线相同。

11. 抛物线:

使用方法是先画一条直线,然后在移动鼠标的过程中抛物线跟随变化,到满意的位置点击鼠标即可。

12. 正弦线:

使用方法和抛物线类似。

13. “文字工具”项:

此功能为提供在K线图中任意一根K线上添加说明性文字的作用。点击此按钮后,找到要添加说明性文字的K线,在此K线上单击一下,就会弹出“文字工具”项的提示窗口,在窗口中输入提示语句,点击“设置字体”可以修改字体及大小,点击“确定”即可在K线中显示出文字的提示。

14.  水平线:

     水平线是直线的一种,其特点是只能画水平的直线。平时我们画水平支撑线的时候,经常画不平,水平线就彻底解决了这个问题。水平线,可以用于捕捉双底形态、三重底形态等,是一种比较有用的工具。

15. 垂直线:

垂直线也是直线的一种,其特点是只能画垂直的直线。

16. 直线段:

     直线段也是直线的一种,其特点是画两点之间的线段。

17. 单向箭头、双向箭头:

     单向箭头和双向箭头,解决了在K线上画图的部分功能,这样使一些简单的画图,不必使用其他的画图软件,在插件本身就可以实现了。

18. 百分比线:

     在上、下两点之间画百分比分割线。从上到下,百分比比率依次是:12.5%、25%、33.33%、37.5%、50%、62.5%、66.67%、75%、87.5%。

19. 椭圆:

     在鼠标指定的一个矩形里面画椭圆。

20. 连续折线:

     画连续折线方法:按下鼠标左键,拖动鼠标到第二个点时松开鼠标;移动鼠标到第三个点,点一下鼠标左键;移动到第四个点……到最后一个点的时候,双击鼠标左键就可以完成画线了。如果双击鼠标右键,折线的第一个点就会和最后一个点连起来,形成闭环。

21. 速阻线:

     所谓速阻线,就是画一根直线的三分之一和三分之二斜率的直线。

22. 上箭头、下箭头:

     这两个画线工具也是方便我们直接在插件上进行画图。

23. 带回归线的通道线:

     带回归线的通道线与普通的通道线的画法相同,只是上下通道线中间多了一条回归直线,也即是通道的中轨。

24. 甘氏线:

     甘氏线,是时间和空间的统一,其横坐标是时间,纵坐标是空间。甘氏线中间的一条线是时间和空间1比1的关系,其他的线依次是2比1、3比1、4比1、5比1或1比2、1比3、1比4、1比5的关系,并且,这些线会跟随1比1直线的移动而按照一定的比率移动。

 

25. 匀加速线:

     匀加速线是在指定的两点画平底抛物线。

26. 音阶线:

     音阶线是模仿音乐音阶设计的。十二声音阶巧妙的把整比关系和等比关系结合在一起。音阶线一共有8条线,最下面的线是基准线,其他线与基准线都接近一个整比关系,分别为:1比1、9比8、5比4、4比3、3比2、5比3、17比9。这些线对于把握股票炒作的节奏有一定的帮助。

27. 螺旋历法线:

     螺旋历法线是按照自然日计算,从基准日开始计算,画月球周期的1倍、1.41、1.73、2.24、2.83等倍数的时间点上,每个数都是费波南列的开方。

     只要起点找对了,其他计算出来的点,都代表时间上的敏感点位,股市容易产生变盘。

28. 时间黄金分割线:

     传统的黄金分割线只能在空间上画上下两点的黄金分割,时间黄金分割线能够在时间上画左右两点的黄金分割。

29. 等换手变周期线:

     即每隔一定的换手率画线,两根线之间的换手率大致相等。

画线工具的子菜单中的最后一项还有一个“画线工具设置”项,用鼠标点击后会弹出如下所示的“画线工具设置”对话框,对话框如下图所示:



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

这就是向下推阻力,看突破。反思惟方法
股不涨就跌,道理就这么简单,要想涨,只有突破,不突破,根本谈不上涨。

方法1:

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

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

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

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

方法2:

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

(这方法风险大,不稳健,而且需要洞悉热惆蹇椋唤ㄒ槌跹д哂茫檬笨裳≡窳魍ㄅ?000-8000左右,活跃性较强,有题材和想象空间的个股做,尤其可选当日涨幅大于2,量比大于1。《一阳穿三线以上,KDJ相对低位或金叉,MACD低背离或二次金叉等指标辅助可提高安全度》)
超短压力线(加入主图即可)

STICKLINE(CLOSE<OPEN and ref(CLOSE,1)>ref(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 AA10<ref(AA10,1), AA10,REF(AA10,1),8,1),COLORgreen;
AA20:=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));  H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1),LINETHICK0;{过滤后低点}
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;
KDTP
input:n(9),m(3);

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

预警: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 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;{输出高点}


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

///以下找phh1之后的最低点,ll表示最低价,pll最低点位置
if phh1<datacount then begin
ll:=fl[phh1+1];
for i=phh1 to datacount do
if ll>fl then begin
ll:=fl; pll:=i;
end;
end;

///以下用zig转折模拟波段,通过参数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<fh then begin
hh2:=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)); H2:=D1 AND NOT(D2 AND E1>=E2);
X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
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:=H<REF(H,REF(BARSLAST(HD),1)+1);
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD; E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2); HH:=E3>REF(E3,1);{找出全部长期高点}
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1)<REF(L,REF(BARSLAST(LD),1)+2+REF(BARSLAST(LD),REF(BARSLAST(LD),1)+2));
D4:=A4 AND B4 AND LD; E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}
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 c<ref(c,1),c,o,8,0),Colorcyan;
stickline(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(c<o,h,l,0,0),Colorcyan;
stickline(c>o,c,o,8,0),Colorred;
stickline(c<o,c,o,8,0)Colorcyan;
高低飞翔

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:=(di<ref(di,1))*di;
gg:="xh-z.gg"(n);  wg:=barslast(gg);  
sg:=sum(gg,0);  gi:=sg[p]-sg+1;    ig:=(gi<ref(gi,1))*gi;
td0:=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:=(sb<ref(sb,1))*sb;
hb:=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)<datacount-t,SYSPARAM(1),SYSPARAM(3)-t);

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

n=16

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(byx<ref(byx,1),byx,ref(byx,1)),COLORgreen;

ma21: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(weekday<ref(weekday,1));

wO: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:=(di<ref(di,1))*di;

gg:="xh-z.gg"(n);  wg:=barslast(gg);  

sg:=sum(gg,0);  gi:=sg[p]-sg+1;    ig:=(gi<ref(gi,1))*gi;

td0:=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:=aad<REFX(aad,1);

bbd:=BACKSET(tjd,peakBARS(m,n,1));

bd:=bbd<REFX(bbd,1);

v2:=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(vv,1),BARSLAST(bd))=1 and peakBARS(m,n,1)=0 and peak(m,n,2)>=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;

  评论这张
 
阅读(325)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018