FS:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
CG:=IF(MA(CLOSE,17)<FS,FS,MA(CLOSE,17));
xg1:crOSS
(MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1),MA(CLOSE,17)+Abs(MA(CLOSE,17)-REF(MA(CLOSE,17),1)))
and (cg-(ema(c,3)-cg))<CLOSE and (cg-(ema(c,3)-cg))<REF((cg-(ema(c,3)-cg)),1);