{公式名称: MACD整合1
公式描述: MACD背离和大智慧优化及二指金叉整合
无参数
公式类型: 技术指标公式-其他类型
画线方法: 副图
公式版本: 0
显示小数: 缺省位数
坐标线位置: 自动
额外Y轴分界: 无
参数精灵:无
用法注释:无
公式源码:}
DRAWGBK(CLOSE>OPEN,RGB(25,25,112),RGB(47,79,79),1,2,1);
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9),COLOR888888;
NOTEXT5:IF(DIF>=DEA,DIF,DRAWNULL),COLORRED;
NOTEXT6:IF(DIF<DEA,DIF,DRAWNULL),COLORWHITE;
XA_1:=BARSLAST(REF(CROSS(DIF,DEA),1));
XA_2:=REF(CLOSE,XA_1+1)>CLOSE AND REF(DIF,XA_1+1)<DIF AND CROSS(DIF,DEA);
XA_3:=BARSLAST(REF(CROSS(KDJ.K(9,3,3),KDJ.D(9,3,3)),1));
XA_4:=BARSLAST(REF(CROSS(DEA,DIF),1));
XA_5:=REF(CLOSE,XA_4+1)<CLOSE AND REF(DIF,XA_4+1)>DIF AND CROSS(DEA,DIF);
MACD底背:IF(XA_2>0,(-0.1),0),COLORRED;
MACD顶背:IF(XA_5>0,0.1,0),COLORGREEN;
STICKLINE(XA_2>0,0.5*DIF,0,2,0),COLORRED;
STICKLINE(XA_5>0,0.5*DIF,0,2,0),COLORGREEN;
MACD:(DIF-DEA)*2,COLORSTICK;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLOR44FF00;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLOR0066FF;
XA_6:=13;
XA_7:=13;
XA_8:=REF(DIF,XA_6)=HHV(DIF,2*XA_6+1);
XA_9:=FILTER(XA_8,XA_6);
XA_10:=BACKSET(XA_9,XA_6+1);
XA_11:=FILTER(XA_10,XA_6);
XA_12:=BACKSET(ISLASTBAR,BARSLAST(XA_11)+1);
XA_13:=XA_12>REF(XA_12,1);
XA_14:=REF(DIF,XA_7)=LLV(DIF,2*XA_7+1);
XA_15:=FILTER(XA_14,XA_7);
XA_16:=BACKSET(XA_15,XA_7+1);
XA_17:=FILTER(XA_16,XA_7);
XA_18:=BACKSET(ISLASTBAR,BARSLAST(XA_17)+1);
XA_19:=XA_18>REF(XA_18,1);
压力线:DRAWLINE(XA_11,DIF,XA_13,DIF,0),DOTLINE,COLORCYAN;
支撑线:DRAWLINE(XA_17,DIF,XA_19,DIF,0),DOTLINE,COLOR00AAFF;
XA_20:=FILTERX(支撑线>REF(支撑线,1) AND DIF>支撑线 AND REF(支撑线,1)=REF(DIF,1),2);
底抬高:DRAWLINE(XA_17,DIF,XA_20,支撑线,0),DOTLINE,COLORYELLOW;
XA_21:=INTPART(3*10/5);
XA_22:=REF(DIF,XA_21)=HHV(DIF,2*XA_21+1);
XA_23:=FILTER(XA_22,XA_21);
XA_24:=BACKSET(XA_23,XA_21+1);
XA_25:=FILTER(XA_24,XA_21);
XA_26:=BACKSET(ISLASTBAR,BARSLAST(XA_25)+1);
XA_27:=XA_26>REF(XA_26,1);
XA_28:=REF(DIF,XA_21)=LLV(DIF,2*XA_21+1);
XA_29:=FILTER(XA_28,XA_21);
XA_30:=BACKSET(XA_29,XA_21+1);
XA_31:=FILTER(XA_30,XA_21);
XA_32:=BACKSET(ISLASTBAR,BARSLAST(XA_31)+1);
XA_33:=XA_32>REF(XA_32,1);
短压线:DRAWLINE(XA_25,DIF,XA_27,DIF,0),DOTLINE,COLOR99FF00;
短撑线:DRAWLINE(XA_31,DIF,XA_33,DIF,0),DOTLINE,COLOR0055FF;
XA_34:=LLV(DEA,43);
XA_35:=DEA-(DIF-DEA);
XA_36:=IF(DIF<XA_34 AND DEA=XA_34,MIN(HHV(XA_34,10),XA_35),XA_34);
XA_37:=REF(LOW,1);
XA_38:=SMA(ABS(LOW-XA_37),13,1)/SMA(MAX(LOW-XA_37,0),13,1)*100;
XA_39:=MA(XA_38,13);
XA_40:=LLV(LOW,34);
XA_41:=EMA(IF(LOW<=XA_40,XA_39,0),3);
XA_42:=SMA(SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,7,1),5,1);
XA_43:=SMA((CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100,8,1)*15-XA_42*10.38;
XA_44:=FILTER(IF(XA_43<=XA_42 AND XA_41>0,XA_41*8,0),5);
止跌:DRAWTEXT(XA_44 AND DIF<XA_36,DIF-11.01,101),COLORYELLOW;
XA_45:=CROSS(DIF,DEA) AND DIF<(-0.1);
STICKLINE(XA_45,0,(-0.18),6,0),COLORYELLOW;
DRAWTEXT(XA_45,(-7.05),102),COLORYELLOW;
XA_46:=IF(CROSS(0,DEA),1,0);
XA_47:=IF(DIF<0 AND CROSS(DIF,DEA),1,0);
XA_48:=IF(XA_46,SUM(XA_47,0),0);
XA_49:=HHV(XA_48,0);
XA_50:=SUM(XA_47,0);
XA_51:=XA_50-XA_49=2 AND XA_50>REF(XA_50,1);
DRAWTEXT(XA_51,DIF-15.05,103),COLOR0080FF;
XA_52:=CROSS(MACD,DIF) AND MACD>=0-0.05 AND MACD<=0.02;
DRAWTEXT(XA_52,MACD,104),COLORYELLOW;
XA_53:=CROSS(DIF,DEA) AND DIF<(-0.1);
XA_54:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
XA_55:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(XA_54=2,21)=1;
STICKLINE(XA_55,0,(-0.58),6,0),COLORMAGENTA;
DRAWTEXT(XA_55,0.1,105),COLOR5500FF;
XA_56:=BARSLAST(REF(CROSS(DIF,DEA),1));
XA_57:=REF(CLOSE,XA_56+1)>CLOSE AND DIF>REF(DIF,XA_56+1) AND CROSS(DIF,DEA);
底背:DRAWLINE(XA_56=0,DIF,XA_57,DIF,0),COLORYELLOW,LINETHICK2;
XA_58:=BARSLAST(REF(CROSS(DEA,DIF),1));
XA_59:=REF(CLOSE,XA_58+1)<CLOSE AND REF(DIF,XA_58+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(XA_58=0,DIF,XA_59,DIF,0),COLORGREEN,LINETHICK2;
DRAWTEXT(XA_57,DIF-30.5,106),COLOR0055FF;
DRAWTEXT(XA_59,DIF*0.5,107),COLOR99FF00;
XA_60:=3;
XA_61:=EMA(CLOSE,3)-(EMA(CLOSE,6)+EMA(CLOSE,7))/2;
XA_62:=EMA(XA_61,3)+EMA(0,2);
XA_63:=REF(XA_61,XA_60)=HHV(XA_61,2*XA_60+1);
XA_64:=FILTER(BB,XA_60) AND XA_61=HHV(XA_61,XA_60+1);
XA_65:=BARSLAST(REF(XA_64,1));
XA_66:=REF(CLOSE,XA_65+1)<CLOSE AND REF(XA_61,XA_65+1)>XA_61 AND XA_64;
DRAWTEXT(XA_66,XA_61*1.2,108),COLORGREEN;
DRAWICON(XA_66>0,XA_61*1.2,2);
XA_67:=REF(XA_61,XA_60)=LLV(XA_61,2*XA_60+1);
XA_68:=BACKSET(XA_67,XA_60+1);
XA_69:=FILTER(XA_68,XA_60) AND XA_61=LLV(XA_61,XA_60+1);
XA_70:=BARSLAST(REF(XA_69,1));
XA_71:=REF(CLOSE,XA_70+1)>CLOSE AND REF(XA_61,XA_70+1)<XA_61;
XA_72:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
XA_73:=CROSS(BACKSET(CROSS(0,MACD),REF(XA_72,1)+2),0.5);
XA_74:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(XA_72,1)+2),0.5);
XA_75:=DRAWLINE(XA_73,MACD,REF(XA_73,1),REF(MACD,1),1);
XA_76:=LLVBARS(MACD,BARSLAST(MACD>0)+1);
XA_77:=CROSS(BACKSET(CROSS(MACD,0),REF(XA_76,1)+2),0.5);
XA_78:=DRAWLINE(XA_77,MACD,REF(XA_77,1),REF(MACD,1),1);
XA_79:=BARSLAST(FILTERX(CROSS(0,MACD),BARSCOUNT(CLOSE)));
XA_80:=IF(MACD<0,FILTERX(MACD=LLV(MACD,BARSLAST(MACD>0)),BARSCOUNT(CLOSE)),DRAWNULL);
XA_81:=BARSLAST(XA_80);
XA_82:=FILTERX(MACD<CONST(LLV(MACD,XA_79+1)),BARSCOUNT(CLOSE));
XA_83:=BARSLAST(XA_82);
XA_84:=IF(XA_79+1>=1,CONST(LLV(MACD,XA_79+1)),DRAWNULL);
XA_85:=CROSS(COUNT(CROSS(MACD>XA_84/2 AND MACD<0,0.5),XA_81)=1,0.5) AND XA_81>=0;
XA_86:=IF(ISLASTBAR AND MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)),1,IF(FILTERX(XA_74,BARSCOUNT(CLOSE)),2,DRAWNULL));
XA_87:=XA_86=1 OR XA_86=2 AND MACD>0;
XA_88:=FILTERX(XA_87,BARSCOUNT(CLOSE));
XA_89:=DRAWLINE(XA_88,MACD,REF(XA_88,1),REF(MACD,1),1);
XA_90:=CROSS(COUNT(CROSS(MACD<XA_89/2 AND MACD>0,0.5),XA_88)=1,0.5) AND XA_88>=0;
STICKLINE(MACD>XA_75,MACD,XA_75,0,0),COLORWHITE;
STICKLINE(MACD<0 AND MACD<XA_78 AND XA_78<0,MACD,XA_78,0,0),COLORWHITE;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
底:ABS((CROSS(MACD.DIF,MACD.DEA) AND MACD.DEA<=(-0.07))*MACD.DIF)*1.5,COLORLIMAGENTA;
DRAWTEXT(ABS(底)>0,底-25,109),COLORYELLOW;
XA_91:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(XA_91,3,1),COLORWHITE;
D:SMA(K,3,1),COLOR00DDDD;
J:3*K-2*D,COLOR800080;
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;
XA_92:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDEXO)/4,AMOUNT/(VOL+0.01)/100);
XA_93:=IF(CLOSE=INDEXC,XA_92+INDEXC-INDEXL,XA_92+(CLOSE-LOW));
XA_94:=IF(CLOSE=INDEXC,INDEXL+INDEXC-XA_92,LOW+(CLOSE-XA_92));
今压:REF(XA_93,1),COLORAA11BB,LINETHICK0;
今撑:REF(XA_94,1),COLOR009900,LINETHICK0;
明压:XA_93,LINETHICK0;
明撑:XA_94,LINETHICK0;
XA_95:=(HHV(HIGH,9.8)-CLOSE)/(HHV(HIGH,9.8)-LLV(LOW,9.8))*101;
XA_96:=SMA(XA_95,3,1);
XA_97:=SMA(XA_96,3,1);
XA_98:=3*XA_96-2*XA_97;
XA_99:=IF(XA_98>=100,100,IF(XA_98<=0,0,XA_98));
明天买:IF(XA_99=100,0-10,0),COLOR00CCCC;
明天卖:IF(XA_99=0,90,100),COLORGREEN;
XA_100:=250;
XA_101:=HHV(K,XA_100);
XA_102:=HHV(D,XA_100);
XA_103:=HHV(J,XA_100);
XA_104:=LLV(K,XA_100);
XA_105:=LLV(D,XA_100);
XA_106:=LLV(J,XA_100);
XA_107:=MAX(XA_101,MAX(XA_102,XA_103));
XA_108:=MIN(XA_104,MIN(XA_105,XA_106));
XA_109:=(XA_107+XA_108)/2;
XA_110:=XA_107-XA_108;
XA_111:=HHV(DIFF,XA_100);
XA_112:=HHV(DEA,XA_100);
XA_113:=HHV(MACD,XA_100);
XA_114:=LLV(DIFF,XA_100);
XA_115:=LLV(DEA,XA_100);
XA_116:=LLV(MACD,XA_100);
XA_117:=MAX(XA_111,MAX(XA_112,XA_113));
XA_118:=MIN(XA_114,MIN(XA_115,XA_116));
XA_119:=(XA_117-XA_118)/100;
XA_120:=XA_117-XA_118;
XA_121:=(0-XA_119)*(XA_110/XA_120)+XA_109;
XA_122:=(DIFF-XA_119)*(XA_110/XA_120)+XA_109;
XA_123:=(DEA-XA_119)*(XA_110/XA_120)+XA_109;
XA_124:=(MACD-XA_119)*(XA_110/XA_120)+XA_109;
XA_125:=MACD<REF(MACD,1) AND MACD>0;
XA_126:=MACD>=REF(MACD,1) AND MACD>0;
XA_127:=MACD>REF(MACD,1) AND MACD<0;
XA_128:=MACD<=REF(MACD,1) AND MACD<0;
STICKLINE(XA_125,XA_121,XA_124,2.7,0),COLOR00AAFF;
STICKLINE(XA_125,XA_121,XA_124,2.6,0),COLOR0066AA;
STICKLINE(XA_125,XA_121,XA_124,2.5,0),COLOR0099DD;
STICKLINE(XA_125,XA_121,XA_124,1.3,0),COLOR00BBEE;
STICKLINE(XA_126,XA_121,XA_124,2.7,0),COLOR0000AA;
STICKLINE(XA_126,XA_121,XA_124,2.6,0),COLOR0011BB;
STICKLINE(XA_126,XA_121,XA_124,2.5,0),COLOR0022CC;
STICKLINE(XA_126,XA_121,XA_124,1.3,0),COLOR0033DD;
STICKLINE(XA_127,XA_121,XA_124,2.7,0),COLORAA00BB;
STICKLINE(XA_127,XA_121,XA_124,2.6,0),COLORBB1177;
STICKLINE(XA_127,XA_121,XA_124,2.5,0),COLORCC2299;
STICKLINE(XA_127,XA_121,XA_124,1.3,0),COLORDD33AA;
STICKLINE(XA_128,XA_121,XA_124,2.7,0),COLORFF7700;
STICKLINE(XA_128,XA_121,XA_124,2.6,0),COLORAA7711;
STICKLINE(XA_128,XA_121,XA_124,2.5,0),COLORCC9922;
STICKLINE(XA_128,XA_121,XA_124,1.3,0),COLOREEBB33;
涨:IF(XA_122>0,XA_122,DRAWNULL),COLOR0055FF;
跌:IF(XA_122<0,XA_122,DRAWNULL),COLOR0055FF;
涨2:IF(XA_123>0,XA_123,DRAWNULL),COLORGREEN;
跌2:IF(XA_123<0,XA_123,DRAWNULL),COLORGREEN;
XA_129:=(HIGH+LOW+CLOSE)/3;
STICKLINE(DIFF>REF(DIFF,1),20,20,2,0),COLORRED;
STICKLINE(DIFF<REF(DIFF,1),20,20,2,0),COLORGREEN;
STICKLINE(K>=REF(K,1) OR K>D AND DIFF>REF(DIFF,1),80,80,2,1),COLORRED;
STICKLINE(K<REF(K,1),80,80,2,1),COLORGREEN;
DRAWTEXT(XA_52,XA_124*0.82,110),COLORYELLOW;
XA_130:=EMA(MA(LOW,3)*0.96,30);
XA_131:=IF(CROSS(DIFF,DEA) AND XA_130-REF(XA_130,1)>0 AND MACD>=REF(MACD,1) AND DIFF<=0,1,0);
DRAWTEXT(XA_131=1,XA_122*1.68,111),COLORCDFFBB;
DRAWTEXT(XA_53,XA_123*0.99,112),COLOR0099DD;
XA_132:=BARSLAST(REF(CROSS(DIFF,DEA),1));
XA_133:=REF(CLOSE,XA_132+1)>CLOSE AND DIFF>REF(DIFF,XA_132+1) AND CROSS(DIFF,DEA);
DRAWTEXT(XA_133,XA_123*0.99-16,113),COLOR0099FF;
XA_134:=BARSLAST(REF(CROSS(DEA,DIFF),1));
XA_135:=REF(CLOSE,XA_134+1)<CLOSE AND REF(DIFF,XA_134+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(XA_135,5),XA_123*1.02,114),COLORDDAAAA;
XA_136:=MACD.DIF#WEEK;
XA_137:=MACD.DEA#WEEK;
XA_138:=FILTER(CROSS(XA_136,XA_137),0);
XA_139:=FILTER(CROSS(XA_137,XA_136),0);
M周金叉:IF(CROSS(MACD.DIF#WEEK,MACD.DEA#WEEK),(-50),0),COLORRED,LINETHICK2;
DRAWTEXT(XA_138,(-45),115),COLORRED;
M周死叉:IF(CROSS(MACD.DEA#WEEK,MACD.DIF#WEEK),(-50),0),COLORGREEN,LINETHICK2;
DRAWTEXT(XA_139,DIF-0.5,116),COLORGREEN;
XA_140:=MACD.DIF#MONTH;
XA_141:=MACD.DEA#MONTH;
XA_142:=FILTER(CROSS(XA_140,XA_141),0);
XA_143:=FILTER(CROSS(XA_141,XA_140),0);
M月金叉:IF(CROSS(MACD.DIF#MONTH,MACD.DEA#MONTH),(-60),0),COLORYELLOW,LINETHICK2;
DRAWTEXT(XA_142,(-35),117),COLORYELLOW;
M月死叉:IF(CROSS(MACD.DEA#MONTH,MACD.DIF#MONTH),(-60),0),COLORFF6600,LINETHICK2;
DRAWTEXT(XA_143,(-35),118),COLORFF6600;
XA_144:=KD.K#WEEK;
XA_145:=KD.D#WEEK;
XA_146:=FILTER(CROSS(XA_144,XA_145),0);
XA_147:=FILTER(CROSS(XA_145,XA_144),0);
K周金叉:IF(CROSS(KDJ.K#WEEK,KDJ.D#WEEK),50,0),COLORRED,LINETHICK2;
DRAWTEXT(XA_146,50,119),COLORGREEN;
K周死叉:IF(CROSS(KDJ.D#WEEK,KDJ.K#WEEK),50,0),COLORGREEN,LINETHICK2;
DRAWTEXT(XA_147,50,120),COLORGREEN;
XA_148:=KDJ.K#MONTH;
XA_149:=KDJ.D#MONTH;
XA_150:=FILTER(CROSS(XA_148,XA_149),0);
XA_151:=FILTER(CROSS(XA_149,XA_148),0);
K月金叉:IF(CROSS(KDJ.K#MONTH,KDJ.D#MONTH),60,0),COLORYELLOW,LINETHICK2;
DRAWTEXT(XA_150,60,121),COLORYELLOW;
K月死叉:IF(CROSS(KDJ.D#MONTH,KDJ.K#MONTH),60,0),COLORFF6600,LINETHICK2;
DRAWTEXT(XA_151,60,122),COLORFF6600;
XA_152:=BARSLAST(REF(CROSS(K,D),1));
XA_153:=REF(CLOSE,XA_152+1)>CLOSE AND REF(K,XA_150+1)<K AND CROSS(K,D);
XA_154:=IF(FILTER(XA_153>0,5),1,0);
DRAWTEXT(XA_154=1,D*0.98,123),COLORDDDDDD;
XA_155:=BARSLAST(REF(CROSS(D,K),1));
XA_156:=REF(CLOSE,XA_155+1)<CLOSE AND REF(K,XA_155+1)>K AND CROSS(D,K);
DRAWTEXT(FILTER(XA_156>0,5),D+8,114),COLORFFAA22;
XA_157:=MA(CLOSE,80)-MA(CLOSE,13)/3;
XA_158:=MA((CLOSE-XA_157)/XA_157,3);
XA_159:=CROSS(XA_158,0) AND LOW/REF(HIGH,1)<1.012 AND J<75 AND J>REF(J,1);
XA_160:=MA(CLOSE,12);
XA_161:=IF(FILTER(MACD>=REF(MACD,5) AND OPEN<=REF(CLOSE,1) AND XA_130-REF(XA_130,1)>0 AND MACD<=0 AND XA_160-REF(XA_160,1)>=0,3) AND J<80 AND J>REF(J,1) AND D>REF(D,1) AND (DIFF>=REF(DIFF,1) OR DEA>=REF(DEA,1)),1,0);
DRAWTEXT(XA_161=1,XA_124*0.98,124),COLOR0099FF;
XA_162:=EMA(CLOSE,2)-EMA(OPEN,5);
XA_163:=IF(CROSS(XA_162,MACD) AND LOW<=XA_130 AND MACD<=0-0.11 AND (J<20 OR K<20),1,0);
DRAWTEXT(FILTER(XA_163,3),0,125),COLOR00CC00;
XA_164:=MA(CLOSE,10);
XA_165:=EMA(MA(HIGH,3)*1.05,30);
XA_166:=IF(FILTER(0.7*(CROSS(DIFF,DEA) AND CLOSE<XA_165 AND XA_130-REF(XA_130,1)>0 AND CROSS(MACD,0) AND MACD>=0 AND DIFF>0 AND XA_164-REF(XA_164,1)>0 AND VOL>REF(VOL,1))>=0.7 AND (CLOSE<XA_165 AND XA_130-REF(XA_130,1)>0),5) AND J<80,1,0);
DRAWTEXT(XA_166=1,XA_124*0.98,126),COLORCDFFDD;
XA_167:=IF(COUNT(XA_158>REF(XA_158,1),3)=3 AND COUNT(XA_158<0,10)=10 AND REF(XA_158,3)=LLV(XA_158,10) AND J<80 AND J>REF(J,1),1,0);
DRAWTEXT(XA_167=1,J,127),COLORFF00CC;
XA_168:=REF(XA_158,2)=LLV(XA_158,20) AND REF(XA_158,2)<0.071 AND REF(XA_158,2)<REF(XA_158,1) AND NOT(REF(LOW,1)>REF(HIGH,2) AND LOW>REF(HIGH,1)) AND CLOSE>REF(CLOSE,1) AND J<75 AND J>REF(J,1);
DRAWTEXT(XA_159 OR XA_168,D-1,128),COLORCYAN;
XA_169:=(INTPART(SMA(XA_91,3,1))+INTPART(SMA(K,3,1)))/2;
XA_170:=CROSS(XA_169,50) AND J<95 AND DIFF>REF(DIFF,1) AND LOW<REF(CLOSE,1);
DRAWTEXT(XA_170,D*0.6,129),COLORCYAN;