S1:=EMA(CLOSE,3);S2:=EMA(CLOSE,6);S3:=EMA(CLOSE,9);S4:=EMA(CLOSE,12);S5:=EMA(CLOSE,15);S6:=EMA(CLOSE,18);S7:=EMA(CLOSE,21);S8:=EMA(CLOSE,24);S9:=EMA(CLOSE,27);S10:=EMA(CLOSE,30);X1:=IF(S1=REF(S1,1),0,IF(S1>REF(S1,1),1,-1));X2:=IF(S2=REF(S2,1),0,IF(S2>REF(S2,1),1,-1));X3:=IF(S3=REF(S3,1),0,IF(S3>REF(S3,1),1,-1));X4:=IF(S4=REF(S4,1),0,IF(S4>REF(S4,1),1,-1));X5:=IF(S5=REF(S5,1),0,IF(S5>REF(S5,1),1,-1));X6:=IF(S6=REF(S6,1),0,IF(S6>REF(S6,1),1,-1));X7:=IF(S7=REF(S7,1),0,IF(S7>REF(S7,1),1,-1));X8:=IF(