You can build this scan using the Condition Wizard. The method requires you to explore all available options and when you see this solution you will open up an entirely new level of understanding about how to use the Condition Wizard.
Here is a link to our free tutorial showing how to use the Condition Wizard:
Screenshot below show how this is setup in the Condition Wizard and here is the text of the code generated by the Condition Wizard according to what you see in the screenshot below:
close crosses above Highest("data" = HIGH, "length" = 19) from 1 bars ago
That the solution for the close crossing the highest high in 20 bars. You can study this solution and work out the other elements on your own.
I will mention some important details:
The right side of the condition is using a built-in function named "Highest()". The offset is adjusted to a value of 1 otherwise it will include the current bar in that measurement and since the close can never be higher than the high of the same bar it this condition would fail unless that offset was adjusted as shown. The length parameter is set to 19 because we are already offsetting the Highest() function one bar to the right, given us a total of 20 bars to work with in the entire computation. Adjust the length parameter as needed to fit your particular preferences.