优化的内容一是对几条乖离线用了我的主图中的多空线和行情线;二是增加了持仓线判断顶底,并可以与二条乖离线配合使用.
用法贝贝乖已经有所说明,其它的自己体会和总结吧.
对不起,不知怎么搞的刚才发错了,现已更正.
N1:=25;34
DRAWGBK(DATE>900101,COLORRGB(110,95,0),COLORRGB(0,20,0),1);
FILLRGN(c>0,25,25/2),COLORGRAY;
INPUT:L1(6,1,12),L2(12,1,24),N(21,1,60);
风光线:50,LINEDOT,coloryellow;
拉升线:25, COLOR7F00FF;
地平线:N1/2,COLORGRAY;
0,colorgreen;
均价:=(2*C+(H-L)/2+L+o)/4;
价差:=SUM(均价-REF(均价,1),2)/2;
高低:=(均价+价差);
实价:=(高低+均价)/2;
aa:=eMA(((SLOPE(实价,n)*20)+实价),N*3);
bb:=eMA(((SLOPE(均价,n)*20)+均价),N*3);
多空:=((AA+bb)/2),COLORRED,PRECISION2;
AaA:=eMA(((SLOPE(实价,N*2)*20)+实价),n*6);
BbB:=eMA(((SLOPE(均价,N*2)*20)+均价),n*6);
行情:=(AAA+BBB)/2,COLORYELLOW,LINETHICK2;
持仓:ma((3*多空-2*行情)/行情*25,1);
FILLRGN(持仓<地平线,地平线,持仓),COLORYELLOW;
DRAWTEXT(持仓<地平线 AND CROSS(持仓,REF(持仓,1)),持仓*0.9,'黄金坑'),ALIGN0,COLORYELLOW;
GL:ma((实价-行情)/行情*100+20,2),COLORWHITE;
GLh:=ma(GL,2),colorGREEN;
PARTLINE(GLh<GL,GL),COLORRED;
GL1:=(实价-MA(实价,L1))/MA(实价,L1)*100+20,colorwhite;
GL2:=(实价-MA(实价,L2))/MA(实价,L2)*100+20,coloryellow;
GL3:=ma((实价-多空)/多空*100+20,2),colorFF8C00;
GL11:=ma(GL1,3),colorwhite;
GL22:=ma(GL2,3),coloryellow;
GL33:ma(GL3,2),colorff00ff;
GL0:=ma(GL33,2),colorGREEN;
m2:if(GL0>GL33,GL33,gl0),colorGREEN;
Q:=CROSS(GL3,GL0) AND GL0<7;
STICKLINE(Q,GL0,30,3,0),COLOR00F0F0;
DRAWTEXT(Q,35,'-乖-'),COLORWHITE ,LINETHICK3 ;
DRAWTEXT(Q AND GL0<0,40,'-乖3'),COLORRED ,LINETHICK3 ;