通达信MACD\KDJ在主图源码指标公式

{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" >
{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);};




未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图