Upper band = daily ATR in pips + daily low.
Lower band = daily high - daily ATR in pips.
Can be used as a reversal signal if there is a good level past ATR. Can go long/short from there.
You may want to add the first two lines of code and update your upperband and loweband variables.
myprevClose0 = close
myprevClose = security(tickerid, 'D', myprevClose0)
upperband = myprevClose + dailyatr
lowerband = myprevClose -dailyatr