{maCD面积}
P:=12;S:=26;M:=9;
difF:ema(C,P) - EMA(C,S);
DEA:EMA(DIFF,M);
MacD值:2*(DIFF-DEA),COLORSTICK,COLORWHITE;
BV:=SUM(macd值,0);
BA:=IF(MAX(BV,REF(BV,2))<REF(BV,1) OR MIN(BV,REF(BV,2))>REF(BV,1),1,0);
BC:=BArslAST(BA)+1;
SMACD:=BV-REF(BV,BC);
VAR3:=IF(MACD值>0,HHV(Abs(MACD值),BC),LLV(MACD值,BC));
VAR4:=(MACD值)/20;{图形比例缩小1/20,可修改}
面积:SMACD,NODRAW;
DRAWNUMBER(REF(VAR4,1)>0 AND VAR4<=0 ,REF(VAR3,1),REF(面积,1)),COLORLIMAGENTA;
DRAWNUMBER(REF(VAR4,1)<0 AND VAR4>=0 ,REF(VAR3,1),REF(ABS(面积),1)),COLORCYAN;
DRAWNUMBER(ISLASTBAR AND VAR4<0,REF(VAR3,1),ABS(面积)),COLORLIMAGENTA;
DRAWNUMBER(ISLASTBAR AND VAR4>0,REF(VAR3,1),面积),COLORCYAN;