股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 将MACD\KDJ 在主图显示


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-10 19:07:53
将MACD\KDJ 在主图显示介绍

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






gd16565

回复

举报

QQ|

GMT+8, 2024-12-29 16:47

快速回复 返回顶部 返回列表