多空博弈指标和MACD指标组合,两个指标一目了然,节省副图资源。
{MACD : 2*(DIF1-DEA1), COLORSTICK;}
{STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.5,0),LINETHICK5,COLORFF00FF;
STICKLINE(MACD>REF(MACD,1)AND MACD>0,0,MACD,0.5,0),LINETHICK5,COLORRED;
STICKLINE(MACD<REF(MACD,1)AND MACD<0,0,MACD,0.5,0),LINETHICK5,COLORGREEN;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.5,0),LINETHICK5,COLORBLUE;
DEA:DEA1,LINETHICK2,COLORYELLOW;
DIF:DIF1,LINETHICK2,COLORRED;}
{DRAWTEXT(CROSS(DEA,DIF),DEA1,' 死叉'), COLOR00FF00;
DRAWTEXT(CROSS(DIF,DEA),DIF-0.1,' 金叉'),COLORYELLOW;
DRAWICON(CROSS(DIF,DEA),DEA1-0.01,1);
DRAWICON(CROSS(DEA,DIF),DIF-0.2,2);
选股1:((MACD>REF(MACD,1)AND CROSS(DIF,DEA))OR (CROSS(MACD,REF(MACD,1))AND DIF>DEA))*0.5;}
DIF:(EMA(CLOSE,7)-EMA(CLOSE,14))*50,LINETHICK2,COLORYELLOW;
MACD:EMA(DIF,3),COLORRED,LINETHICK2;
DEF:2*(DIF-MACD),COLORFFFF00,LINETHICK0;
STICKLINE(DEF>=0 AND DEF>=REF(DEF,1),0,DEF,2,1),COLORRED;
STICKLINE(DEF>=0 AND DEF< REF(DEF,1),0,DEF,2,0),COLORGREEN;
STICKLINE(DEF<0 AND DEF>=REF(DEF,1),0,DEF,2,1),COLORGREEN;
STICKLINE(DEF<0 AND DEF< REF(DEF,1),0,DEF,2,0),COLORBLUE;
ST:=IF(DEF>0 AND REF(DEF,1)>REF(DEF,2) AND DEF< REF(DEF,1),1,0);
SJ:=IF(DEF<0 AND REF(DEF,1)< REF(DEF,2) AND DEF>REF(DEF,1),1,0);
ZL:=IF(CROSS(C,MA(C,20)) OR CROSS(C,MA(C,60)),1,0);
ZC:=IF(CROSS(MA(C,20),C) OR CROSS(MA(C,60),C),1,0);
ZD:=IF(CROSS(MACD,DIF) AND DIF>0 AND MACD>0,1,0);
ZK:=IF(CROSS(DIF,MACD) AND DIF<0 AND MACD<0,1,0);
DRAWICON(CROSS(DIF,MACD)AND DEF>0,MACD,1);
DRAWICON(CROSS(MACD,DIF),DIF,2);
DRAWICON(CROSS(DIF,MACD)AND DEF>0,DEF,1);
XG:CROSS(DIF,MACD) AND DEF>0;
EE:=MACD-REF(MACD,1)>0.05 AND
COUNT(C/REF(C,1)>1.09,16)<2 AND
C=HHV(H,60) AND
C/REF(C,1)>1.04 AND
NOT(H=L) AND
COUNT(C>O,6)<=4 AND
C/REF(C,9)<1.2,NODRAW;
STICKLINE(FILTER(EE,20),ABS(MACD)+1,0,2,0),COLORMAGENTA;
选股:FILTER(EE,20);
VAR1:=(HHV(HIGH,21)-C)/(HHV(HIGH,21)-LLV(LOW,21))*100-10;
VAR2:=(C-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
VAR3:=SMA(VAR2,13,8);
高位:90;
低位:0;
多方:SMA(VAR3,13,8),COLORRED;
空方:SMA(VAR1,21,8),COLOR00FF00;
中轴:45;
DRAWICON(CROSS(多方,空方),多方,11);
DRAWICON(CROSS(空方,多方),空方,12);