看到“请教:如何理解SLOPE函数?”,我在主图试了一下,主要是在波动市中,买卖点太多,所以在网上搜了一下,找到一个相类似的源码。我一向是看均线操作,所以改了一下均线的显示。
{N:1 180 2 ; M 1 180 21}
VAR1:=EMA(C,N);
VAR2:=EMA(SLOPE(C,M)*20+C,42);
VAR3:=CROSS(VAR1,VAR2);
VAR4:=CROSS(VAR2,VAR1);
MA10:=MA(C,10); STICKLINE(VAR1=VAR2,LOW,HIGH,0,0),COLORRED;
MA20:=MA(C,20);
IF(MA10>=MA20,MA20,DRAWNULL),COLORRED;
IF(MA10
DRAWTEXT(VAR3,LOW*0.95,'买'),COLORYELLOW,LINETHICK3;
DRAWTEXT(VAR4,HIGH*1.028,'卖'),COLORGREEN,LINETHICK3;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1>=VAR2,CLOSE,OPEN,2,0),COLORRED;
STICKLINE(VAR1