最新更新 - 网站地图 -
您的当前位置:首页 > 股票指标 > KDJ指标 > 通达信MACD+KDJ+RSI背离指标公式

通达信MACD+KDJ+RSI背离指标公式

来源:网络 点击: 时间:2022-12-22 13:29:06

SHORT:=12;
LONG:=26;
MID:=9;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
IF(DIF>DEA,DIF,DRAWNULL)COLOR0099FF;
{0,COLORWHITE,DOTLINE;}
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWICON(B1>0,LLV(DIF,60)*0.84,1);
DRAWTEXT(B1>0,LLV(DIF,60)*0.85,'..MACD'),COLOR9900FF;{MACD底背离}
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWICON(D1>0,HHV(DIF,60)*0.84,2);
DRAWTEXT(D1>0,HHV(DIF,60)*0.85,'..MACD'),COLORFFCC00;{MACD顶背离}
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)> C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D") {AND "KDJ.J"<30};
DRAWICON(B2>0,LLV(DIF,60)*0.59,1);
DRAWTEXT(B2>0,LLV(DIF,60)*0.60,'..KDJ'),COLORFF33FF;{KDJ底背离}
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1) "KDJ.K" AND CROSS("KDJ.D","KDJ.K") {AND "KDJ.J">70};
DRAWICON(D2>0,HHV(DIF,60)*0.59,2);
DRAWTEXT(D2>0,HHV(DIF,60)*0.60,'..KDJ'),COLORFFFF99;{KDJ顶背离}
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)> C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2") {AND "RSI.RSI1"<40};
DRAWICON(B3>0,LLV(DIF,60)*0.34,1);
DRAWTEXT(B3>0,LLV(DIF,60)*0.35,'..RSI'),COLOR6699FF;{RSI底背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1) "RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1") {AND "RSI.RSI1">60};
DRAWICON(D3>0,HHV(DIF,60)*0.34,2);
DRAWTEXT(D3>0,HHV(DIF,60)*0.35,'..RSI'),COLORFFCC99;{RSI顶背离}
JC:=DEA-DIF;
绿柱:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
红柱:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低价:=LLV(L,BARSLAST(JC<0));
本次最高价:=HHV(H,BARSLAST(JC>0));
X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);
前次绿柱:=REF(绿柱,X1+1);
前次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱<0 AND ABS(绿柱)AND 本次最低价<前次最低价),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价
AND ABS(绿柱)底背驰:=IF (CROSS(DIF,DEA),REF(Y1,1),0);
DRAWICON(底背驰,LLV(DIF,60)*0.1,1);
DRAWTEXT(底背驰,LLV(DIF,60)*0.1,'..柱'),COLOR00CCFF;{柱底背离}
X2:=IF(MACD>0,BARSLAST(CROSS(DEA,DIF)),0);
前次红柱:=REF(红柱,X2+1);
前次最高价:=REF(本次最高价,X2+1);
Y2:=IF((红柱>0 AND 红柱<前次红柱 AND 本次最高价>前次最高价),1,0);
RS2:=MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 AND ABS(红柱)顶背驰:=IF(CROSS(DEA,DIF),REF(Y2,1),0);
DRAWICON(顶背驰,HHV(DIF,60)*0.1,2);
DRAWTEXT(顶背驰,HHV(DIF,60)*0.1,'..柱'),COLORFFCCCC;{柱顶背离}
{ 以下是可能出现的变盘点,关注 }
STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1)= 7,0,MACD,0.5,0),COLORFF6666;
STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1)=15,0,MACD,0.5,0),COLORFF6666;
STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1)=28,0,MACD,0.5,0),COLORFF6666;
STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1)=36,0,MACD,0.5,0),COLORFF6666;
STICKLINE(COUNT(DIF>DEA,BARSLAST(CROSS(DIF,DEA))+1)=48,0,MACD,0.5,0),COLORFF6666;
STICKLINE(COUNT(DIFSTICKLINE(COUNT(DIFSTICKLINE(COUNT(DIFSTICKLINE(COUNT(DIFSTICKLINE(COUNT(DIF

通达信MACD+KDJ+RSI背离指标公式

    Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号

    免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!

    Top