About atr scalein from last tradeprice

I am not able to do scalein when the price falls 2ATR (10) from the price of the last purchase.
I have tried with the following code, but it is not correct.
Somebody could help me.? thanks.

indicator1= RSI(10);
indicator2= RSI(6);
buycondition= indicator1 < 30 ;
sellcondition= indicator2 > 70;
newentrycondition = Low < ValueWhen(Buy, Close)-(2*ATR(10));
Buy = 	IIf(buycondition , 1, 	IIf(newentrycondition, sigScaleIn, 0));
Sell= sellcondition;


Do you have the solution already ? Because i have the same problem