您现在的位置:好股网 >> 股票公式 >> 通达信公式 >> 一键转帖:将MACD\KDJ 在主图显示

将MACD\KDJ 在主图显示


指标功能:[B]国产软件[/B]
指标类型:简体中文
所需积分:0
推荐星级:
授权方式:共享版
公式大小:0 Bytes
更新时间:2011-11-24 08:48:00
公式简介:

{MACD+KDJ在主图显示}
{以下显示叠加指针的数值}
K:"KDJ.K",NODRAW,COLORWHITE;
D:"KDJ.D",NODRAW,COLORYELLOW;
R1:"RSI.RSI1",NODRAW,COLORC080FF;
R2:"RSI.RSI2",NODRAW,COLORFF8080;
R3:"RSI.RSI3",NODRAW,COLOR87F8F4;
F:"MACD.DIF",NODRAW,COLOR72C072;
A:"MACD.DEA",NODRAW,COLORE98210;
M:"MACD.MACD",NODRAW,COLORWHITE;
{以下计算叠加比和叠加平移量}
{1、叠加字段高度}
Q:=130;
KH:=HHV(H,Q);
KL:=LLV(L,Q);
DH:=HHV(MAX(K,D),Q);
DL:=LLV(MIN(K,D),Q);
MH:=HHV(MAX(F,A),Q);
ML:=LLV(MAX(F,A),Q);
RH:=HHV(MAX(MAX(R1,R2),R3),Q);
RL:=LLV(MIN(MIN(R1,R2),R3),Q);
{2、叠加比}
BD:=(KH-KL)/(DH-DL)/3;
BM:=(KH-KL)/(MH-ML)/3;
BR:=(KH-KL)/(RH-RL)/3;
{3、叠加平移量}
WK:=(KH-KL)/3;
WD:=(KH+KL-(DH+DL)*BD)/2-CONST(WK);
WM:=(KH+KL-(MH+ML)*BM)/2;
WR:=(KH+KL-(RH+RL)*BR)/2+CONST(WK);
{以下画叠加线}
PLOYLINE(1,K*CONST(BD)+CONST(WD)),COLORWHITE;
PLOYLINE(1,D*CONST(BD)+CONST(WD))COLORYELLOW;
{PLOYLINE(1,R1*CONST(BR)+CONST(WR)),COLORC080FF;
PLOYLINE(1,R2*CONST(BR)+CONST(WR)),COLORFF8080;
PLOYLINE(1,R3*CONST(BR)+CONST(WR)),COLOR87F8F4;}
PLOYLINE(1,F*CONST(BM)+CONST(WM)),COLOR72C072;
PLOYLINE(1,A*CONST(BM)+CONST(WM)),COLORE98210;
STICKLINE(M>0,M*CONST(BM)+CONST(WM),CONST(WM),0,-1),COLORMAGENTA;
STICKLINE(M<0,M*CONST(BM)+CONST(WM),CONST(WM),0,-1),COLORGREEN;
{以下画叠加指针的横坐标线}
PLOYLINE(1,CONST(WM)),COLORWHITE;
{PLOYLINE(1,20*CONST(BR)+CONST(WR)),COLORGREEN,POINTDOT;
PLOYLINE(1,80*CONST(BR)+CONST(WR)),COLORRED,POINTDOT;
PLOYLINE(1,50*CONST(BR)+CONST(WR)),COLORYELLOW,POINTDOT;}
PLOYLINE(1,20*CONST(BD)+CONST(WD)),COLORGREEN,POINTDOT;
PLOYLINE(1,80*CONST(BD)+CONST(WD)),COLORRED,POINTDOT;
PLOYLINE(1,50*CONST(BD)+CONST(WD)),COLORYELLOW,POINTDOT;
{以下显示叠加指针的横坐标值}
{DRAWTEXT(CURRBARSCOUNT=1,(80*CONST(BR)+CONST(WR))*1.015,'80')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(80*CONST(BR)+CONST(WR))*0.99,'RSI')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(50*CONST(BR)+CONST(WR))*1.015,'50')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(50*CONST(BR)+CONST(WR))*0.99,'RSI')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(20*CONST(BR)+CONST(WR))*1.015,'20')COLORWHITE;}
DRAWTEXT(CURRBARSCOUNT=1,(20*CONST(BD)+CONST(WD))*1.015,'20')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(20*CONST(BD)+CONST(WD))*0.99,'KDJ')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(50*CONST(BD)+CONST(WD))*1.015,'50')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(50*CONST(BD)+CONST(WD))*0.99,'KDJ')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(80*CONST(BD)+CONST(WD))*1.015,'80')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,(80*CONST(BD)+CONST(WD))*0.99,'KDJ')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,CONST(WM)*1.015,'0')COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=1,CONST(WM)*0.99,'MACD')COLORWHITE;
{A:=BACKSET(ISLASTBAR,BARSLAST(CROSS(K,D))+1);};



[url=http://www.goodgupiao.com/gupiaogongshi/16565.html][B]将MACD\KDJ 在主图显示[/B][/url]