九毛八公式指标
{★MACD-(快速)} input: P(19,15,100), S(7,5,140), M(9,2,80); {-----------------------☆功能开关------------------------} {资金} ZJ1:=DMA((H+L+C*2)/4,0.9); ZJ2:=V/((H-L)*2-ABS(C-O)); ZJ3:=IF(C>O,ZJ2*(H-L),IF(C公式模块:
{资金}
ZJ1:=DMA((H+L+C*2)/4,0.9); ZJ2:=V/((H-L)*2-ABS(C-O)); ZJ3:=IF(C>O,ZJ2*(H-L),IF(C<O,ZJ2*(H-O+(C-L)),V/2))+IF(C>O,0-ZJ2*(H-C+(O-L)),IF(C<O,0-ZJ2*(H-L),0-V/2)); ZJ4:=ZJ3/20/1.15; ZJ5:=ZJ4*0.55+REF(ZJ4,1)*0.33+REF(ZJ4,2)*0.22; ZJ6:=EMA(ZJ5,3); {macd} P:=19;S:=7;M:=9; MJ_1 := EMA(CLOSE,S) - EMA(CLOSE,P); MJ_2 := EMA(MJ_1,M); MJ_3 := 2*(MJ_1-MJ_2); MJ_4:=REVERSE(MJ_3)+2*WMA(WMA(MJ_3,1),5); MJ_5:=3*MJ_4-2*SMA(MJ_4,2,1); {形态} 低金:=crOSS(MJ_1,MJ_2) AND MJ_1<-0.1;{低金} SA0:=COUNT(CROSS(MJ_1,MJ_2) AND MJ_2<0,21)=3; 零下二次金叉:=CROSS(MJ_3,0) AND SA0;{零下二次金叉} SA1:=COUNT(CROSS(MJ_1,MJ_2),BArslAST(MJ_2>=0)); 二金:=(CROSS(MJ_1,MJ_2) AND MJ_2<0 AND COUNT(SA1=2,21)=1)*2;{二次金叉} SA2:=BARSLAST(REF(CROSS(MJ_1,MJ_2),1)); 底背:=(REF(C,SA2+1)>C AND MJ_1>REF(MJ_1,SA2+1) AND CROSS(MJ_1,MJ_2))*3;{底背} 三全:=低金 AND 二金 AND 底背; SA3:=BARSLAST(REF(CROSS(MJ_2,MJ_1),1)); 顶背:=REF(C,SA3+1)<C AND REF(MJ_1,SA3+1)>MJ_1 AND CROSS(MJ_2,MJ_1);{顶背} {信号} M_C1:=EMA(C,5)/EMA(EMA(C,9),16)<=0.85 AND C/REF(C,1)<1.05 AND C/REF(C,1)>0.905 AND V/CAPITAL*100<5; M_C2:=MIN(REF(C,2)*0.865,REF(C,13)*0.772); M_C3:=(C-M_C2)/C<0.03; 满仓:=M_C1 AND M_C3; X:=BARSLAST(BacKSET(ISLASTBAR,1)=1)+1; Z_1:=REF(MJ_2,1)+((M+1)/(2*(M-1)))*REF(MJ_3,1); Z_2:=((P-1)*(S+1)*REF(EMA(C,P),1)-(P+1)*(S-1)*REF(EMA(C,S),1)+(S+1)*(P+1)*REF(MJ_1,1))/(2*P-2*S); Z_3:=((P-1)*(S+1)*REF(EMA(C,P),1)-(P+1)*(S-1)*REF(EMA(C,S),1)+(S+1)*(P+1)*REF(MJ_2,1))/(2*P-2*S); Z_4:=((P-1)*(S+1)*REF(EMA(C,P),1)-(P+1)*(S-1)*REF(EMA(C,S),1)+(S+1)*(P+1)*Z_1)/(2*P-2*S); Y_1:=(MJ_2*X+((M+1)/(2*(M-1)))*MJ_3*X); Y_2:=((P-1)*(S+1)*EMA(C,P)*X-(P+1)*(S-1)*EMA(C,S)*X+(S+1)*(P+1)*MJ_1*X)/(2*P-2*S); Y_3:=((P-1)*(S+1)*EMA(C,P)*X-(P+1)*(S-1)*EMA(C,S)*X+(S+1)*(P+1)*MJ_2*X)/(2*P-2*S); Y_4:=((P-1)*(S+1)*EMA(C,P)*X-(P+1)*(S-1)*EMA(C,S)*X+(S+1)*(P+1)*Y_1)/(2*P-2*S); {MACD} DRAWBAND(MJ_1,RGB(255,154,104),MJ_2,RGB(0,192,255)); DRAWBAND(MJ_3,RGB(255,183,255),MJ_5,RGB(0,65,0)); DIFF: MJ_1,COLORWHITE; DEA: MJ_2,COLORYELLOW; 加速:2.8*(MJ_2-MJ_1),NODRAW,COLORGREEN; NOTEXT1:IF(CURRBARSCOUNT<=34,加速,DRAWNULL),COLORGREEN,DOTLINE; 多头: MJ_3,LINETHICK2,COLORRED; 预警:MJ_5,COLORFF8900,COLORFFB500; {---} 换手:IF(CAPITAL=0,V/SUM(V,100)*100,V/FINANCE(7)*10000),NODRAW,COLORGRAY; 涨跌幅:(C-REF(C,1))/REF(C,1)*100,NODRAW,COLORGRAY; 市赢率:DYNAINFO(39),NODRAW,COLORGRAY; 市净率:C/FINANCE(34),NODRAW,COLORGRAY; STICKLINE(MJ_3<REF(MJ_3,1) AND MJ_3<0,0,MJ_3,0,0),COLORFFCF78;{蓝} STICKLINE(MJ_3<REF(MJ_3,1) AND MJ_3>0,0,MJ_3,0,0),COLORYELLOW;{黄} STICKLINE(MJ_3>REF(MJ_3,1) AND MJ_3<0,0,MJ_3,0,0),COLORAF00AF;{紫} STICKLINE(MJ_3>REF(MJ_3,1) AND MJ_3>0,0,MJ_3,0,0),COLORRED;{红} NOTEXT2:IF(MJ_1>=REF(MJ_1,1) AND MJ_2<REF(MJ_2,1),MJ_1,DRAWNULL),LINETHICK2,COLORMAGENTA;{粉} NOTEXT3:IF(MJ_1<REF(MJ_1,1) AND MJ_2>REF(MJ_2,1),MJ_1,DRAWNULL),LINETHICK2,COLORBLUE; {资金} NOTEXT4:0,LINETHICK2,COLORWHITE;{负} NOTEXT5:IF(ZJ6>=0,0,DRAWNULL),LINETHICK2,COLORRED;{正}; {形态} DRAWTEXT(低金,DEA*0.98,'▲'),COLOR00C300; DRAWTEXT(零下二次金叉,DEA*0.98,'▲▲'),COLOR00C300; DRAWTEXT(二金,DEA*0.98,'▲▲'),COLOR00C300; DRAWTEXT(底背,DEA*0.98,'↑'),COLORMAGENTA; DRAWTEXT(三全,DEA*0.98,'▲▲▲'),COLORRED; DRAWTEXT(顶背,DEA,'▼▼'),COLORFF5B00; {信号} DRAWTEXT(满仓,加速,' 第二天买'),COLORYELLOW; DRAWICON(满仓,MJ_1*0.96,5);{多空差:34.47 成功率:83.08%}; DRAWTEXT_FIX(ISLASTBAR,0.005,0,0,STRCAT('今日DIFF转折:',CON2STR(Z_2,2))),COLORGREEN; DRAWTEXT_FIX(ISLASTBAR,0.005,0.12,0,STRCAT('今日DEA转折:',CON2STR(Z_3,2))),COLORGREEN; DRAWTEXT_FIX(ISLASTBAR,0.005,0.24,0,STRCAT('今日MACD转折:',CON2STR(Z_4,2))),COLORGREEN; DRAWTEXT_FIX(ISLASTBAR,0.005,0.55,0,STRCAT('明日DIFF转折:',CON2STR(Y_2,2))),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.67,0,STRCAT('明日DEA转折:',CON2STR(Y_3,2))),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.79,0,STRCAT('明日MACD转折:',CON2STR(Y_4,2))),COLORYELLOW;