For this solution I have included three user inputs at the top of the code. You can adjust the start date and end date as well as the percent change. The code forms a target period within which the close of the first bar of the target period is carried forward indefinitely. Then it does the same with the high for the target period, tracking the highest high within the target period. Each of these values is carried forward to the current bar. At which point the code measures the percent change between the close and the highest high of the target period.
FYI, your end date was a date the markets were closed. But the code is written so that it can adapt to those types of input errors. You can only use this on the daily time frame or higher. it will utterly fail if you try to use it on any intraday time frame.
input startDate = 20210719;
input endDate = 20210725;
input percentThreshold = 3.0;
def targetPeriod = DaysFromDate(startDate) >= 0 and DaysTillDate(endDate) >= 0;
rec trackHighest = if targetPeriod and !targetPeriod then high else if targetPeriod and high > trackHighest then high else trackHighest;
rec trackStartPrice = if targetPeriod and !targetPeriod then close else trackStartPrice;
def percentChange = 100 * (trackHighest / trackStartPrice - 1);
plot scan = percentChange > percentThreshold;