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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 精准KDJ,高手觉的不好的优化一下


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

以下是精准KDJ,高手觉的不好的优化一下

{精准KDJ}

RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),COLORWHITE;
D:SMA(K,3,1),COLORYELLOW;
J:3*K-2*D,COLORYELLOW;
IF(K<REF(K,1),K,DRAWNULL),COLORGREEN,LINETHICK1;
IF(D<REF(D,1),D,DRAWNULL),COLORGREEN,LINETHICK1;
IF(J<REF(J,1),J,DRAWNULL),COLORFFFF00,LINETHICK1;
IF(K>REF(K,1),K,DRAWNULL),COLORRED,LINETHICK1;
IF(D>REF(D,1),D,DRAWNULL),COLORRED,LINETHICK1;
IF(J>REF(J,1),J,DRAWNULL),COLORFF00FF,LINETHICK1;

OBV:=K;
P:=5;
A1:=REF(OBV,P)=HHV(OBV,2*P+1);
B1:=FILTER(A1,P);
阶段卖出:116,COLORC6C600;
3.5,COLOR0088FF;
{清仓卖出: 3.5,COLORFF75FF;}
动力线:=K;
STICKLINE(动力线>REF(动力线,1) ,动力线 ,REF(动力线,1),3 ,1),COLORRED;
STICKLINE(动力线<=REF(动力线,1) ,动力线 ,REF(动力线,1),3 ,1),COLOR00FF00;
底部:0.2,COLOR70DB93;
{关注:0.5,COLORYELLOW;}


C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);{高点}
A2:=REF(OBV,P)=LLV(OBV,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);{低点}
↑上:REF(OBV,BARSLAST(D1)),COLORFF00FF,NODRAW;
↓下:REF(OBV,BARSLAST(D2)),COLOR00FF00,NODRAW;
向上:CROSS(OBV,↑上*1.01),NODRAW;
相对能量:(OBV-↓下)/(↑上-↓下)*100,COLORYELLOW,NODRAW;
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
DRAWLINE(D1,OBV,S11,OBV,1),COLOR0000FF;
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,OBV,U11,OBV,1),COLORFFFF00;
STICKLINE(C>0,↓下,↓下,1,0),COLOR00FF00;
STICKLINE(C>0,↑上,↑上,1,0),COLORFF00FF;
DRAWTEXT(CROSS(OBV,↑上*1.01),↑上,'↑上'),COLORFFFFFF;
DRAWTEXT(CROSS(↓下*0.99,OBV),↓下,'↓下'),COLORFFFFFF;

{主升波段显示}
BBI:=(EMA(CLOSE,3)+EMA(CLOSE,6)+EMA(CLOSE,12)+EMA(CLOSE,24))/4;
EBBI:=(EMA(C,6)+EMA(C,18)+EMA(C,54)+EMA(C,162))/4;
FF1:=EMA(C,3)>EMA(C,7) AND EMA(C,7)>EMA(C,21) AND EMA(C,21)>EMA(C,54);
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
主升浪:IF(BBI>EBBI AND FF1 AND DIFF>DEA,10,0),COLORYELLOW,POINTDOT;
STICKLINE(主升浪,10,0,1,1),COLORYELLOW;
DRAWICON(CROSS(K,D) AND CROSS(J,D),10,1);{1号图标显示红箭头};
DRAWICON(D1,OBV,2);
DRAWICON(D2,OBV,1);





回复

举报

QQ|

GMT+8, 2024-11-17 18:51

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