Based on the standard deviation of the price added or subtracted to a simple moving average, the standard deviation error is added to the moving average for an upper envelope and subtracted from the moving average for a lower envelope.
UPt is the upper envelope
DNt is the lower envelope
MAt is an n period moving average
a is the number of standard deviations to add or subtract for the moving average (integers or fractions are permissible).
s2 is the standard deviation squared
Reference: John Bollinger, Bollinger Capital Management, Manhattan Beach, CA