I had to update the title of your question because it did not at all match the description in your request. The title of your question requested to scan for stocks that were 2% of ATR. Which works out to the following mathematical formula: close == ATR * 0.02.
This is completely the opposite direction of your stated request. So the question title now matches the description you provided in your question.
There is also a missing component from your request. I must provide this missing component before providing a solution so I will explain what that is. The ATR is a measure of True Range that has been averaged over several bars. The default being 14. So when you say "stock price that is 1.5 time ATR" you are trying to comparing an apple with an orange. The price of a stock can never be compared to value of the ATR directly. Because the current price is a single data point and the ATR is derived from the High, Low and Close. The correct way to compare this is to compare the current bar's True Range to the ATR. That is an apples to apples comparison.
Here is what that looks like in code:
input length = 14;
input averageType = AverageType.WILDERS;
def atr = MovingAverage(averageType, TrueRange(high, close, low), length);
plot scan = TrueRange(high, close, low) >= atr * 1.5;