N:=18;P:=2;
黄金线: EMA(CLOSE,N),POINTDOT,LINETHICK4,COLORYELLOW;
上升压力: 黄金线 + P*STD(CLOSE,N),LINETHICK2,COLOR0099FF;
下跌支撑: 黄金线 - P*STD(CLOSE,N),LINETHICK2,COLORMAGENTA;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,18);
DRAWTEXT(CROSS(FF,MA15),(LOW * 0.99),'买入'),COLOR00FFFF;
DRAWTEXT(CROSS(MA15,FF),(HIGH * 1.02),'卖出'),COLOR00FF00;
DRAWTEXT(CROSS(85,RSI),(HIGH * 1.02),'注意!'),COLORFFFFFF;
A:=(3*C+L+O+H)/6;
{}
X:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+
14*REF(A,6)+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/210;
主力成本:EMA(X,13),COLORFF00FF,LINETHICK1;