The mistake in your code is marked by the editor:
plot ATR[1] = MovingAverage(averageType, TrueRange(high, close, low), length);
So we know this line of your code contains an error. Unfortunately the editor does not provide any detail. The problem is the index value you have applied in the plot statement, as follows:
plot ATR[1] =....
You cannot apply an index to any variable declaration. You are on the right track, the only detail you missed is exactly WHERE to apply the index value to offset the label to display the value from the previous bar. That location is within the AddLabel() statement, as follows:
plot ATR[1] = MovingAverage(averageType, TrueRange(high, close, low), length);
Here is what your solution looks like once the errors have been corrected:
input length = 14;
input averageType = AverageType.WILDERS;
plot ATR = MovingAverage(averageType, TrueRange(high, close, low), length);
AddLabel(yes, Concat("ATR = ", ATR[1]), Color.YELLOW);
Please note I have corrected some minor typos in your code and inserted spaces between parameters to make the code easier to read.