Narrow Range 7 (NR7) is Daily range smaller than last 7 days
The below code is for hourly chart you can change the values acording to the charts
Buy Script:
MAX(CLOSE, 50) < CLOSE
if you want to sell at intraday you can do so manually by keeping the target price