MACD解盘指标(副图) 通达信公式

[复制链接]
查看139 | 回复0 | 2021-8-20 15:49:44 | 显示全部楼层 |阅读模式

151325Q12330-1V35.jpg

151325Q12330-1V35.jpg


{MACD解盘} DRAWGBK(C > 0,RGB(10,160,0),RGB(25,15,0),0,' ',0); DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORYELLOW,LINETHICK2; DEA1:=EMA(DIFF,9); 0.10,POINTDOT; MACD:=2*(DIFF-DEA1),LINETHICK0; SS1:=MACD < REF(MACD,1)AND MACD > 0; SS2:=MACD < REF(MACD,1)/2 AND MACD < 0; STICKLINE(MACD > =0,MACD,0,3,1),COLORRED; STICKLINE(SS1,0,MACD,3,1),COLOR00FFFF; STICKLINE(SS2,0,MACD,3,0),COLORFFFFFF; STICKLINE(MACD > REF(MACD,1)AND MACD < 0,0,MACD,3,1),COLORFFFF00; EMA(CLOSE,12) - EMA(CLOSE,26),COLORYELLOW,LINETHICK2; DEA:EMA(DIFF,9),COLORGREEN; IF(DIFF > DEA,DIFF,DRAWNULL),COLORFF11CC,LINETHICK2; IF(DIFF > DEA AND DIFF < 0,DIFF,DRAWNULL),COLORRED,LINETHICK2; DRAWICON(CROSS(DIFF,DEA),DIFF-0.1,1); DRAWICON(CROSS(DEA,DIFF),DIFF+0.1,2); MAC:3*DIFF-2*DEA1,LINETHICK1,COLORRED; VAR1:=EMA(CLOSE,34)-EMA(CLOSE,5); VAR2:=EMA(VAR1,5); 趋势:=(-3)*(VAR1-VAR2); VAR11:=MA((V/(H-L)),4); VAR33:=ABS(C-O); VAR44:=V/(H-L); 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; DMP:= SUM(IF(HD > 0 AND HD > LD,HD,0),14); DMM:= SUM(IF(LD > 0 AND LD > HD,LD,0),14); PDI:= DMP*100/TR; MDI:= DMM*100/TR; ADX:= MA(ABS(MDI-PDI)/(MDI+PDI)*100,6); ADXR:=(ADX+REF(ADX,6))/2; M周▲:DRAWTEXT(CROSS("MACD.DIF#WEEK" ,"MACD.DEA#WEEK"),DEA1-0.05,'▲M周'),COLORRED; M月个:DRAWTEXT(CROSS("MACD.DIF#MONTH" ,"MACD.DEA#MONTH"),DEA1-0.05,'个M月'),COLORMAGENTA; W1:=CROSS(MA(C,10),MA(C,5)) ; W2:=CROSS(MA(C,5),MA(C,10)) ; W3:=CROSS(MA(V,10),MA(V,5)); W4:=CROSS(DEA,DIFF); W11:=C < =MA(C,5) AND C < =MA(C,10) ; W22:=O > MA(C,5) AND O > MA(C,10) ; W33:=MA(V,5) < =MA(V,10); W44:=DIFF < DEA; W5:=VOL/CAPITAL; DRAWTEXT(W11 AND  W22 AND W33 AND W44,DIFF,'#'),COLORFFFF10; LC := REF(CLOSE,1); RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100; RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100; PSY:=COUNT(CLOSE > REF(CLOSE,1),12)/12*100; AA:=(EMA(C,30)*2+MA(C,60))/3; RA:=(VOL*CLOSE); VL1A:=EMA(RA,13)/EMA(VOL,13); VL2A:=EMA(RA,60)/EMA(VOL,60); VLA:=EMA((VL1A+VL2A)/2,3); 分水岭:=MA((AA+VLA)/2,1),LINETHICK0; BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4; UPR:=BBI+3*STD(BBI,10); DWN:=BBI-3*STD(BBI,10); VAR55:=(UPR-DWN)/UPR < 0.03; VAR56:=(UPR-DWN)/UPR > 0.18; VAR57:=(MA(C,60)-MA(C,5))/MA(C,60) > 0.15; VAR58:=(MA(C,5)-MA(C,60))/MA(C,5) > 0.15; S1:=趋势 > 0;  S2:=趋势 < 0;  S3:=CROSS(趋势,0);  S4:=CROSS(0,趋势);   S5:=CROSS(PDI,MDI);  S6:=CROSS(MDI,PDI);  S7:=ADX > REF(ADX,1);  S8:=W11 AND W22; S9:=W1;  S10:=W3;  S11:=W4;  S12:=W11 AND W22 AND W33 AND W44;  S13:=W11 AND W33 AND W44;  S14:=W5 > 0.075;  S15:=RSI1 > 85;  S16:=RSI1 > 80; S17:=RSI1 < 15;  S18:=CROSS(RSI1,15);  S19:=CROSS(RSI1,85);  S20:=CLOSE > 分水岭; S21:=CLOSE < 分水岭;  S22:=VAR55;  S23:=VAR57 AND VAR56; SS:=CONST((S1+S2+S3+S4+S5+S6+S7+S8+S9+S10+S11+S12+S13+S14+S15+S16+S17+S18+S19+S20+S21 +S22+S23)*110),NODRAW; DRAWRECTREL(0,0,270,SS,RGB(0,120,0));   E1:=IF(S1=1 ,-0.08,-0.08); E2:=IF(S2=1,E1+0.1,E1); E3:=IF(S3=1,E2+0.1,E2); E4:=IF(S4=1,E3+0.1,E3); E5:=IF(S5=1,E4+0.1,E4); E6:=IF(S6=1,E5+0.1,E5); E7:=IF(S7=1,E6+0.1,E6); E8:=IF(S8=1,E7+0.1,E7); E9:=IF(S9=1,E8+0.1,E8); E10:=IF(S10=1,E9+0.1,E9); E11:=IF(S11=1,E10+0.1,E10); E12:=IF(S12=1,E11+0.1,E11); E13:=IF(S13=1,E12+0.1,E12); E14:=IF(S14=1,E13+0.1,E13); E15:=IF(S15=1,E14+0.1,E14); E16:=IF(S16=1,E15+0.1,E15); E17:=IF(S17=1,E16+0.1,E16); E18:=IF(S18=1,E17+0.1,E17); E19:=IF(S19=1,E18+0.1,E18); E20:=IF(S20=1,E19+0.1,E19); E21:=IF(S21=1,E20+0.1,E20); E22:=IF(S22=1,E21+0.1,E21); E23:=IF(S23=1,E22+0.1,E22); DRAWTEXT_FIX(ISLASTBAR AND S1=1,0,E1,0,'Z线趋势上升中'); DRAWTEXT_FIX(ISLASTBAR  AND S2=1,0,E2,0,'Z线趋势下降中'); DRAWTEXT_FIX(ISLASTBAR  AND S3=1,0,E3,0,'Z线考虑买入'); DRAWTEXT_FIX(ISLASTBAR  AND S4=1,0,E4,0,'Z线考虑卖出'); DRAWTEXT_FIX(ISLASTBAR  AND S5=1,0,E5,0,'PDI突破MDI,有新多进场'); DRAWTEXT_FIX(ISLASTBAR  AND S6=1,0,E6,0,'PDI跌破MDI,有新空进场'); DRAWTEXT_FIX(ISLASTBAR  AND S7=1,0,E7,0,'ADX高于前一日,维持原趋势'); DRAWTEXT_FIX(ISLASTBAR  AND S8=1,0,E8,0,'断头铡刀:,卖出'),COLORGREEN; DRAWTEXT_FIX(ISLASTBAR  AND S9=1,0,E9,0,'5日死叉10均线,短线卖出'); DRAWTEXT_FIX(ISLASTBAR  AND S10=1,0,E10,0,'5日死叉10日均量,卖出'); DRAWTEXT_FIX(ISLASTBAR  AND S11=1,0,E11,0,'DIFF下穿DEA,空头形成,卖出'); DRAWTEXT_FIX(ISLASTBAR  AND S12=1,0,E12,0,'三死叉见顶,卖出'),COLORFF00FF; DRAWTEXT_FIX(ISLASTBAR  AND S13=1,0,E13,0,'多方溃败,卖出'),COLORGREEN; DRAWTEXT_FIX(ISLASTBAR  AND S14=1,0,E14,0,'换手过大,小心主力出逃'); DRAWTEXT_FIX(ISLASTBAR  AND S15=1,0,E15,0,'6日RSI超买,防止回挡'); DRAWTEXT_FIX(ISLASTBAR  AND S16=1,0,E16,0,'6日RSI向上突破85,超买'); DRAWTEXT_FIX(ISLASTBAR  AND S17=1,0,E17,0,'6日RSI超卖,有可能反弹'); DRAWTEXT_FIX(ISLASTBAR  AND S18=1,0,E18,0,'6日RSI向上突破15,买进信号'); DRAWTEXT_FIX(ISLASTBAR  AND S19=1,0,E19,0,'6日RSI向下跌破85,卖出信号'); DRAWTEXT_FIX(ISLASTBAR  AND S20=1,0,E20,0,'分水岭之上,多头,可积极做多'); DRAWTEXT_FIX(ISLASTBAR  AND S21=1,0,E21,0,'分水岭之下,空头,只能抢反弹'); DRAWTEXT_FIX(ISLASTBAR  AND S22=1,0,E22,0,'布林收敛中,有变盘可能'); DRAWTEXT_FIX(ISLASTBAR  AND S23=1,0,E23,0,'布林乖离太大,有反弹可能');
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则