# Begin Scan # New 52wk Highs (or equal to 52wk High) # Written by Ed Carter # def C = close; def MAXC52 = Highest(close, 252); # # Notice that the MAXC52 (Highest CLOSE of 52wk is defeined here in terms of 252 days # because you want to go back a day within the logic below) # # If you wanted this to be above the previous Highest HIGH, you would just change the # definition to " def MAXC52 = Highest(high, 252); " # plot New52WkHigh = ( C >= MAXC52[1] # #check if Today's Close was above or equal to the 52wk High Close as of yesterday # C[1] < MAXC52[1] # #check if Yesterday's Close was below the 52wk High Close as of yesterday # ); # End Scan