Bollinger Bands with adjustable periods and width
The middle Bollinger Band is a simple moving average. The upper and lower bands sit k standard deviations above and below it. With a middle at 100 and a window standard deviation of 4, a multiplier of 2 gives 108 and 92. With the same inputs a multiplier of 1.5 gives 106 and 94. John Bollinger’s band rules
Loading candle history…
Change width and lookback separately
Start with period 20 and multiplier 2. Find a quiet interval and a volatile one. Change only the multiplier to 1 and compare the bands on the same candles. The center stays fixed while the distance to the bands halves. Return to 2 and lengthen the period. This changes the mean and the sample of prices contributing to the deviation.
When comparing plots, check whether the underlying formula divides squared deviations by n or n−1. At short windows that choice changes the width noticeably. Compare the dates after both series have warmed up. To turn a band crossing into a testable rule, specify how to confirm it and at what price the subsequent order may execute.
Continue with close versus next-open execution.