《股票-老狼的四合一顶底背离公式源码及使用说明,(MACD,RSI,KDJ,DMI).docx》由会员分享,可在线阅读,更多相关《股票-老狼的四合一顶底背离公式源码及使用说明,(MACD,RSI,KDJ,DMI).docx(9页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、老狼的四合一顶底背离公式源码及使用说明,(MACD,RSI,KDJ,DMI)四合一背离研判原那么:这是MACD,RSI,KDJ,DMI指标组合的顶底背离指标,0线上不同颜色柱是顶背离,也就是相对顶部,0线下不同颜色的柱是底背离,也就是相对底部.该指标的主要特点是:运用MACD这个指标的同时可看到其它几个指标的顶底预测点位,为你参与卖出股票提供全方位的参考.大智慧【已经修改了大智慧可以用】DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=(DIFF-DEA)*2;TR:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-R
2、EF(CLOSE,1),ABS(LOW-REF(CLOSE,1),14);HD:=HIGH-REF(HIGH,1);LD:=REF(LOW,1)-LOW;PDM:=SUM(IF(HD>0ANDHD>LD,HD,0),14);MDM:=SUM(IF(LD>0ANDLD>HD,LD,0),14);PDI:=PDM*100/TR;MDI:=MDM*100/TR;A1:=BARSLAST(ref(cross("macd.diff"(12,26,9),"macd.dea"(12,26,9),1);B1:=ref(c,A1+1)>can
3、dref("macd.diff"(12,26,9),A1+1)<"macd.diff"(12,26,9)andcross("macd.diff"(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)>candref("kdj.k"(9,3,3),A2+1)<"kdj.k"(
4、9,3,3)andcross("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)>candref("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24)andcross("RSI.RSI1"(6,12,24),"RSI.RSI2&
5、quot;(6,12,24);C1:=BARSLAST(ref(cross("macd.dea"(12,26,9),"macd.diff"(12,26,9),1);D1:=ref(c,C1+1)<candref("macd.diff"(12,26,9),C1+1)>"macd.diff"(12,26,9)andcross("macd.dea"(12,26,9),"macd.diff"(12,26,9);C2:=BARSLAST(ref(cross("kd
6、j.d"(9,3,3),"kdj.k"(9,3,3),1);D2:=ref(c,C2+1)<candref("kdj.k"(9,3,3),C2+1)>"kdj.k"(9,3,3)andcross("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)<candre
7、f("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24)andcross("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24);C4:=BARSLAST(ref(cross(mdi,pdi),1);D4:=ref(c,C+1)<candref(mdi,C4+1)>mdiandcross(mdi,pdi);A4:=BARSLAST(ref(cross(PDI,MDI),1);B4:=ref(c,A4+1)>candref(pdi,
8、A4+1)<pdiandcross(pdi,mdi);DMI底背:IF(B4>0,-0.1,0),COLOR0099FF,POINTDOT;MACD底背:if(B1>0,-0.1,0),colorred,pointdot;KDJ底背:if(B2>0,-0.1,0),colorff00ff,pointdot;RSI底背:if(B3>0,-0.1,0),coloryellow,pointdot;DMI顶背:IF(D4>0,0.1,0),COLORBLUE,POINTDOT;MACD顶背:if(D1>0,0.1,0),color00ff00,pointdot
9、;KDJ顶背:if(D2>0,0.1,0),colorffcc66,pointdot;RSI顶背:if(D3>0,0.1,0),colorwhite,pointdot;STICKLINE(B1>0,-0.1,0,6,0),colorred;STICKLINE(B2>0,-0.1,0,6,0),colorff00ff;STICKLINE(B3>0,-0.1,0,6,0),coloryellow;STICKLINE(d1>0,0.1,0,6,0),color00ff00;STICKLINE(d2>0,0.1,0,6,0),colorffcc66;STICK
10、LINE(d3>0,0.1,0,6,0),colorwhite;STICKLINE(B4>0,-0.1,0,6,0),color0099ff;STICKLINE(D4>0,0.1,0,6,0),colorblue;通达信N1=12;N2=26;N3=9;N4=14;N5=24DIFF:=EMA(CLOSE,N1)-EMA(CLOSE,N2);DEA:=EMA(DIFF,N3);TR:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1),ABS(LOW-REF(CLOSE,1),N4);HD:=HIGH-REF(HIGH,1);LD:=REF(
11、LOW,1)-LOW;PDM:=SUM(IF(HD>0ANDHD>LD,HD,0),N4);MDM:=SUM(IF(LD>0ANDLD>HD,LD,0),N4);PDI:=PDM*100/TR;MDI:=MDM*100/TR;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1);B1:=REF(C,A1+1)>CANDREF(DIFF,A1+1)<DIFFANDCROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3),1)
12、;B2:=REF(C,A2+1)>CANDREF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3)ANDCROSS("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)>CANDREF("RSI.RSI1"(6,12,24),A3+1)<&qu
13、ot;RSI.RSI1"(6,12,24)ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24);C1:=BARSLAST(REF(CROSS(DEA,DIFF),1);D1:=REF(C,C1+1)<CANDREF(DIFF,C1+1)>DIFFANDCROSS(DEA,DIFF);C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3),1);D2:=REF(C,C2+1)<CANDREF(&q
14、uot;KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3)ANDCROSS("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)<CANDREF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24)ANDC
15、ROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24);C4:=BARSLAST(REF(CROSS(MDI,PDI),1);D4:=REF(C,C+1)<CANDREF(MDI,C4+1)>MDIANDCROSS(MDI,PDI);A4:=BARSLAST(REF(CROSS(PDI,MDI),1);B4:=REF(C,A4+1)>CANDREF(PDI,A4+1)<PDIANDCROSS(PDI,MDI);DMI底背:IF(B4>0,-0.1,0),COLOR0099FF,POINTDO
16、T;MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORFF00FF,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;DMI顶背:IF(D4>0,0.1,0),COLORBLUE,POINTDOT;MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLO
17、RWHITE,POINTDOT;STICKLINE(B1>0,-0.1,0,3,0),COLORRED;STICKLINE(B2>0,-0.1,0,3,0),COLORFF00FF;STICKLINE(B3>0,-0.1,0,3,0),COLORYELLOW;STICKLINE(D1>0,0.1,0,3,0),COLOR00FF00;STICKLINE(D2>0,0.1,0,3,0),COLORFFCC66;STICKLINE(D3>0,0.1,0,3,0),COLORWHITE;STICKLINE(B4>0,-0.1,0,3,0),COLOR0099FF;STICKLINE(D4>0,0.1,0,3,0),COLORBLUE;1.bmp(1.42MB,下载次数:8)下载附件2020-9-2308:24上传 本帖最后由布施大行于2020-9-2309:18编辑