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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信远大 MACD+KDJ副图,源码,简单实用的好指标


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2023-10-8 20:26:31

以下是通达信远大 MACD+KDJ副图,源码,简单实用的好指标

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),LINETHICK2;
D:SMA(K,3,1),LINETHICK2;
J:3*K-2*D,LINETHICK2,COLORRED;
DIFF:EMA(CLOSE,12)-EMA(CLOSE,21),COLORGREEN,NODRAW;
DEA :EMA(DIFF,9),COLORBLUE,NODRAW;
MACD:2*(DIFF-DEA),COLORRED,NODRAW;
RSV1:=(HHV(H,9.8)-C)/(HHV(H,9.8)-LLV(L,9.8))*101;
KK:=SMA(RSV1,3,1);
DD:=SMA(KK,3,1);
JJ:=3*KK-2*DD;
KX:=250;
KH:=HHV(K,KX);
DH:=HHV(D,KX);
JH:=HHV(J,KX);
KL:=LLV(K,KX);
DL:=LLV(D,KX);
JL:=LLV(J,KX);
HKMAX:=MAX(KH,MAX(DH,JH));
LKMIN:=MIN(KL,MIN(DL,JL));
KHLB:=(HKMAX+LKMIN)/2;
KHLC:=HKMAX-LKMIN;
MHF:=HHV(DIFF,KX);
MHD:=HHV(DEA,KX);
MHM:=HHV(MACD,KX);
MLF:=LLV(DIFF,KX);
MLD:=LLV(DEA,KX);
MLM:=LLV(MACD,KX);
HMAX:=MAX(MHF,MAX(MHD,MHM));
LMIN:=MIN(MLF,MIN(MLD,MLM));
FHLB:=(HMAX-LMIN)/100;
FHLC:=HMAX-LMIN;
SH:=(0-FHLB)*(KHLC/FHLC)+KHLB;
DIFFA:=(DIFF-FHLB)*(KHLC/FHLC)+KHLB;
DEAA:=(DEA-FHLB)*(KHLC/FHLC)+KHLB;
DRAWBAND(DIFFA,RGB(255,11,11),DEAA,RGB(10,255,10));
MACDA:=(MACD-FHLB)*(KHLC/FHLC)+KHLB;
CDA:=MACD<REF(MACD,1) AND MACD>0;
CDB:=MACD>=REF(MACD,1) AND MACD>0;
CDC:=MACD>REF(MACD,1) AND MACD<0;
CDD:=MACD<=REF(MACD,1) AND MACD<0;
STICKLINE(CDA,SH,MACDA,2.3,0),COLOR00AAFF;{黄色段}
STICKLINE(CDA,SH,MACDA,2.0,0),COLOR00BBFF;
STICKLINE(CDA,SH,MACDA,1.8,0),COLOR00CCFF;
STICKLINE(CDA,SH,MACDA,1.5,0),COLOR00DDFF;
STICKLINE(CDA,SH,MACDA,1.0,0),COLOR00EEFF;
STICKLINE(CDA,SH,MACDA,0.5,0),COLOR00FFFF;
STICKLINE(CDB,SH,MACDA,2.3,0),COLOR0000AA; {红色段}
STICKLINE(CDB,SH,MACDA,2.0,0),COLOR0011BB;
STICKLINE(CDB,SH,MACDA,1.8,0),COLOR0022CC;
STICKLINE(CDB,SH,MACDA,1.5,0),COLOR0033DD;
STICKLINE(CDB,SH,MACDA,1.0,0),COLOR0044EE;
STICKLINE(CDB,SH,MACDA,0.5,0),COLOR0055FF;
STICKLINE(CDC,SH,MACDA,2.3,0),COLORAA00BB;{向上粉红}
STICKLINE(CDC,SH,MACDA,2.0,0),COLORBB11BB;
STICKLINE(CDC,SH,MACDA,1.8,0),COLORCC22BB;
STICKLINE(CDC,SH,MACDA,1.5,0),COLORDD33BB;
STICKLINE(CDC,SH,MACDA,1.0,0),COLOREE44BB;
STICKLINE(CDC,SH,MACDA,0.5,0),COLORFF55BB;
STICKLINE(CDD,SH,MACDA,2.3,0),COLORFF7700;
STICKLINE(CDD,SH,MACDA,2.0,0),COLORFF8811;
STICKLINE(CDD,SH,MACDA,1.8,0),COLORFFAA22;
STICKLINE(CDD,SH,MACDA,1.5,0),COLORFFBB33;
STICKLINE(CDD,SH,MACDA,1.0,0),COLORFFDD44;
STICKLINE(CDD,SH,MACDA,0.5,0),COLORFFDD55;
DRAWTEXT(BARSTATUS=2,SH,' 0轴'),COLOR00AAAA;
100,COLORRED,DOTLINE;
0,COLORGREEN,DOTLINE;
110,COLORMAGENTA,DOTLINE;
-10,COLORLIGREEN,DOTLINE;
连长:BARSLASTCOUNT(MACD>REF(MACD,1)),NODRAW;
连短:BARSLASTCOUNT(MACD<REF(MACD,1)),NODRAW;
红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW;
绿柱面积:IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),NODRAW;
红柱天:BARSLASTCOUNT(MACD>0),NODRAW;
绿柱天:BARSLASTCOUNT(MACD<0),NODRAW;
TJ:=MACD>0;
T:=MACD<0;
DRAWTEXT(BARSLAST(TJ)=1,MACDA*0.99,'1');
DRAWTEXT(BARSLAST(TJ)=3,MACDA*0.99,'3');
DRAWTEXT(BARSLAST(TJ)=5,MACDA*0.99,'5');
DRAWTEXT(BARSLAST(TJ)=8,MACDA*0.99,'8');
DRAWTEXT(BARSLAST(TJ)=13,MACDA*0.99,'13');
DRAWTEXT(BARSLAST(TJ)=21,MACDA*0.99,'21');
DRAWTEXT(BARSLAST(TJ)=34,MACDA*0.99,'34');
DRAWTEXT(BARSLAST(T)=1,MACDA*1.01,'1');
DRAWTEXT(BARSLAST(T)=3,MACDA*1.01,'3');
DRAWTEXT(BARSLAST(T)=5,MACDA*1.01,'5');
DRAWTEXT(BARSLAST(T)=8,MACDA*1.01,'8');
DRAWTEXT(BARSLAST(T)=13,MACDA*1.01,'13');
DRAWTEXT(BARSLAST(T)=21,MACDA*1.01,'21');
DRAWTEXT(BARSLAST(T)=34,MACDA*1.01,'34');





回复

举报

QQ|

GMT+8, 2024-11-27 14:36

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