N:=5;N1:=30;
VAR0:=EMA(EMA(EMA(CLOSE,N),N),N);
VAR1: VAR0-REF(VAR0,1)+VAR0;
VAR2: MA(VAR1,N1);
STICKLINE(VAR1>VAR2,VAR2,VAR1,0.1,1),COLORRED;
STICKLINE(VAR2>VAR1,VAR1,VAR2,0.1,1),COLORGREEN;
DRAWTEXT(crOSS(VAR2,VAR1),VAR1*1.01,'↓降'), , COLORGREEN;
DRAWTEXT(CROSS(VAR1,VAR2),VAR2*0.99,'↑升'), , COLORYELLOW;