var11:=(2*c+o+h+l)/5;
var12:=vol;
m8:=sum(var11*var12,8)/sum(var12,8);
m13:=sum(var11*var12,13)/sum(var12,13);
m21:=sum(var11*var12,21)/sum(var12,21);
r1:=c;
r2:=llv(low,45);
r3:=hhv(high,45);
y1:=c;
y2:=llv(low,144);
y3:=hhv(high,144);
RSV1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV1,3,1),linethick1,colorff00ff;
D:=SMA(K,3,1),linethick2,coloryellow;
RSVR:=((r1-r2)/(r3-r2))*100;
Kr:=SMA(RSvr,3,1),colorred;
Dr:=SMA(Kr,3,1),coloryellow;
RSVy:=((y1-y2)/(y3-y2))*100;
Ky:=SMA(RSVy,3,1),colorccee33;
Dy:=SMA(Ky,3,1),coloryellow;
X1:=m8;
X2:=m13;
X3:=m21;
XX:=C>X2 AND C>X2 ,;
LC := REF(CLOSE,1);
rsi1:=SMA(MAX(CLOSE-LC,0),8,1)/SMA(Abs(CLOSE-LC),8,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),21,1)/SMA(ABS(CLOSE-LC),21,1)*100,;
DIFF:= EMA(CLOSE,8) - EMA(CLOSE,21);
DEA:= EMA(DIFF,8);
macd:= 2*(DIFF-DEA);
J13:=m8-m21,;
K13:=SMA(J13,3,1), ;
D13:=SMA(K13,3,1), ;
MacD13:=4*(k13-D13);
js:= MACD>0 AND K>D AND RSI1>50 AND DR<60 AND dy<60 AND XX>0 and macd13>0 and
macd13>ref(macd13,1);
XG:= js>0 and cross(k,d) and cross(macd,0)and ma(v,5)>ma(v,40);
短:=d,color00FF00,LINETHICK1;
短1:=ref(d,1),colorred,LINETHICK1;
中:=dr,coloryellow,LINETHICK1;
中1:=ref(dr,1),colorf0f000;
长:=dy,colorFF00FF,LINETHICK1;
长1:=ref(dy,1),colorFF00FF,LINETHICK1;
aaa:=cross(d,ref(d,2))and 短1<50 and dr>ref(dr,1)and dy>ref(dy,1) and d<30 and dr<20 and dy <20 ;
黄金令:STICKLINE(aaa>0,0,50,6,0),coloryellow;
白银令:STICKLINE(xg>0,0,50,6,0),colorwhite;
短期主力:d,color00FF00,LINETHICK1;
中期主力:dr,color0099ff,LINETHICK1;
长期主力:dy,colorFF00FF,LINETHICK1;
90;10;