Need code with NR7 logic, to buy and sell stock for intraday

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

Script error. code is not working… Please resend correct one… Thanks.

I update the NR7 list of stocks daily in the google spread sheet, you can access it here.

https://goo.gl/YqW1Xd