MACD看透主力 副图公式
DRAWGBK(C>0, RGB(40,120,20),RGB(00,00,00),0,0,1),LINETHICK2;
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV1:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
OBV2:=EMA(OBV1,3)-MA(OBV1,9);
OBV3:=EMA(IF(OBV2>0,OBV2,0),3);
MAC3:=MA(C,3);
SHORT:=12;LONG:=26;MID:=9;
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG)COLORYELLOW,LINETHICK2 ;
DEA:EMA(DIF,MID)COLORFF9900 ,LINETHICK2;
MACD:=(DIF-DEA)*2;
DRAWICON(CROSS(DIF,DEA),DIF,1);
DRAWICON(CROSS(MACD,0),MACD,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
STICKLINE(OBV3>REF(OBV3,1) AND MAC3>REF(MAC3,1),0,MACD,2,0),COLORYELLOW;
持币:STICKLINE((SAR(10,2,20)>=H),MACD,0,1.5,0),COLORGREEN;
持股:STICKLINE((SAR(10,2,20)<=L),0,MACD,1.5,0),COLORYELLOW;
吸:=XLPL.NOTEXT吸,COLORLIRED,CIRCLEDOT,LINETHICK3;
拉:=XLPL.NOTEXT拉,COLORRED,CIRCLEDOT,LINETHICK3;
派:=XLPL.NOTEXT派,COLORGREEN,CIRCLEDOT,LINETHICK3;
落:=XLPL.NOTEXT落,COLORWHITE,CIRCLEDOT,LINETHICK3;
STICKLINE(吸,0,MACD,1,0),COLORLIRED;
STICKLINE(拉,0,MACD,1,0),COLORRED;
STICKLINE(派,0,MACD,1,0),COLORGREEN;
STICKLINE(落,0,MACD,1,0),COLORWHITE;
入1:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK1;
入2:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLOR00FF00,LINETHICK1;
0,LINETHICK2;
建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;
加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;
DRAWTEXT(入1,-0.2,'↖入1'),COLORFFFFFF;
白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;
趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;
AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;
VAR0004:="MACD.DIF#WEEK"(6,13,5);
VAR0005:="MACD.DEA#WEEK"(6,13,5);
VAR0006:="MACD.MACD#WEEK"(6,13,5);
VAR7:="MACD.DIF#MONTH"(6,13,5);
VAR8:="MACD.DEA#MONTH"(6,13,5);
周金叉:IF(CROSS(VAR0004,VAR0005),0.3,0)LINESTICK, COLORRED,LINETHICK3;
月金叉:IF(CROSS(VAR7,VAR8),-0.5,0)LINESTICK, COLORYELLOW,LINETHICK3;
零轴金叉:IF(CROSS(VAR0004,0),0.2,0)LINESTICK, COLORYELLOW,LINETHICK2;
DRAWTEXT(CROSS(VAR0004,VAR0005),-0.2,'↖ 周金叉'),COLORFFFFFF;
DRAWTEXT(CROSS(VAR0004,0),-0.2,'↖ 零轴金叉'),COLORFFFFFF;
0,LINETHICK3;
DRAWICON(CROSS(MACD,0),MACD,1);
DRAWICON(CROSS(DIF,0),DIF,1);
DRAWICON(CROSS(DIF,DEA),DIF,1);
DRAWICON(CROSS(DEA,DIF),DEA,2);
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
DRAWTEXT(低位金叉,-0.2,'低位金叉'),COLORFFFFFF;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉1:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.18,10,0),COLOR0042CC;
STICKLINE(二次金叉,0,-0.18,8,0),COLOR004FF2;
STICKLINE(二次金叉,0,-0.18,8,0),COLOR3375FF;
740455227.png
|