顶底背离组合通达信公式 副图 源码附图

TRR := SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),14);
HD := HIGH-REF(HIGH,1);
LD := REF(LOW,1)-LOW;
PDM:= SUM(IF(HD>0 AND HD>LD,HD,0),14);
MDM:= SUM(IF(LD>0 AND LD>HD,LD,0),14);
PDI:= PDM*100/TRR;
MDI:= MDM*100/TRR;
A1:=BARSLAST(REF(CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9)),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF"(12,26,9),A1+1)<"MACD.DIF"(12,26,9) AND CROSS("MACD.DIF"(12,26,9),"MACD.DEA"(12,26,9));
A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));
C1:=BARSLAST(REF(CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9)),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF"(12,26,9),C1+1)>"MACD.DIF"(12,26,9) AND CROSS("MACD.DEA"(12,26,9),"MACD.DIF"(12,26,9));
C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));
C4:=BARSLAST(REF(CROSS(MDI,PDI),1));
D4:=REF(C,C+1)<C AND REF(MDI,C4+1)>MDI AND CROSS(MDI,PDI);
A4:=BARSLAST(REF(CROSS(PDI,MDI),1));
B4:=REF(C,A4+1)>C AND REF(PDI,A4+1)<PDI AND CROSS(PDI,MDI);
DRAWTEXT(B4>0,5,'DMI底背'),COLOR0099FF;
DRAWTEXT(D4>0,95,'DMI顶背'),COLORBLUE;
DRAWTEXT(B1>0,15,'MACD底背'),COLORRED;
DRAWTEXT(B2>0,10,'KDJ底背'),COLORFF00FF;
DRAWTEXT(B3>0,18,'RSI底背'),COLORYELLOW;
DRAWTEXT(D1>0,85,'MACD顶背'),COLOR00FF00;
DRAWTEXT(D2>0,90,'KDJ顶背'),COLORFFCC66;
DRAWTEXT(D3>0,96,'RSI顶背'),COLORFFFFFF;
STICKLINE(B1>0,20,0,0,0),COLORRED;
STICKLINE(B2>0,20,0,0,0),COLORFF00FF;
STICKLINE(B3>0,20,0,0,0),COLORYELLOW;
STICKLINE(D1>0,80,100,0,0),COLOR00FF00;
STICKLINE(D2>0,100,80,0,0),COLORFFCC66;
STICKLINE(D3>0,100,80,0,0),COLORWHITE;
STICKLINE(B4>0,20,0,0,0),COLOR0099FF;
STICKLINE(D4>0,100,80,0,0),COLORBLUE;
VAR188:=((CLOSE - LLV(LOW,34))/(HHV(HIGH,34) - LLV(LOW,34)))*(100);
VAR288:=REVERSE(VAR188);
VAR388:=SMA(VAR188,9,1);
K88:=SMA(VAR388,3,1);
D88:=SMA(K88,3,1);
STICKLINE((K88 >= D88),K88,D88,1,0),COLOR0000FF;
STICKLINE((K88 <= D88),K88,D88,1,0),COLOR00FF00;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MMACD:=(DIFF-DEA)*2;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));
K:=SMA(RSV,9,3);
D:=SMA(K,9,3);
J:=3*K-2*D;
A:=CROSS(DIFF,DEA) AND CROSS(K,D) AND CROSS(J,D) AND DIFF<0;
SA:=CROSS(DEA,DIFF) AND CROSS(D,K) AND CROSS(D,J) AND DIFF>0;
DRAWTEXT(FILTER(A,10)=1,12,' 金叉'),COLORYELLOW;
STICKLINE(FILTER(A,10)=1,0,20,2,0),COLORRED ;
DRAWTEXT(FILTER(SA,10)=1,97,'死叉'),COLORYELLOW;
 



来函数检测结果如下:
该公式没有未来函数

解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式

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

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