{N1:=6;
N2:=12;
XD:=((EXPMA(CLOSE,500)-REF(EXPMA(CLOSE,500),1))/REF(EXPMA(CLOSE,500),1)*100)*100;
XD1:=MA(XD,3);
XD15:=MA(XD,15);
XD30:=MA(XD,30);
MID:=MA(XD,10);
X:=(C-REF(C,1))*100/REF(C,1);
ZQ:=BARSLAST(CROSS(XD,XD1) OR XD=XD1);
ZQ1:=REF(ZQ,1)+1;
ZQ2:=REF(XD1,ZQ1);
ZQ3:=REF(XD,ZQ1);
B1:=MA(C,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1);
XH1:=XD>=XD1 AND REF(XD,1)<REF(XD1,1) AND C>=B2;
LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
XG:CROSS(XH1,XD1) AND CROSS(RSI1,RSI2) AND "MACD.DIF">"MACD.DEA";