Bollinger Bands Period Settings: Which Lookback Works Best?
We tested Bollinger Bands periods from 5 to 200 across seven deviations and three USD/JPY timeframes. Period 20 led hourly bars, but the winner changed by timeframe.
The “Period” or “Length” box in Bollinger Bands determines how many bars build both the centre line and its standard deviation. Twenty is the conventional default, but 20 bars on a 15-minute chart cover five hours while 20 four-hour bars cover 80 hours.
We tested 12 periods from 5 through 200, seven deviations from 0.5σ through 2σ, and three readings of the bands. The grid ran on 15-minute, hourly and four-hour USD/JPY bars across 2024, 2025 and both halves of 2025: 3,024 backtests in all.
There was no single best bar count. Averaging the breakout across deviations and years, period 50 led M15, period 20 led H1 and period 5 led H4. The counts look unrelated, but they cover 12.5, 20 and 20 hours. The most useful result is therefore not “always use 20”; it is to compare periods as elapsed market time.
What the Bollinger Bands period changes
For period N and deviation k, the bands are built in three steps:
- Average the last N closes to produce the centre line
- Measure the population standard deviation of those same N closes
- Add and subtract k times that standard deviation
A longer period makes the centre line slower and keeps earlier volatility in the band width for longer. The measured effect on hourly USD/JPY in 2025 at 1σ was substantial.
| Period | Mean half-width | Closes inside | Annual trades |
|---|---|---|---|
| 5 | 12.79 pips | 47.1% | 934 |
| 20 | 28.51 pips | 45.0% | 277 |
| 50 | 46.54 pips | 45.8% | 103 |
| 100 | 65.62 pips | 44.9% | 68 |
| 200 | 88.68 pips | 50.3% | 46 |
The band became almost seven times wider and trades fell by about 95%. Yet containment stayed between 44.9% and 50.3%. Increasing period did not steadily increase the percentage of closes inside 1σ, because both width and the horizon used to estimate the mean changed.
Short periods can make a deviation unreachable
There is a mathematical boundary when the current close is one of the N values used in a population standard deviation. The largest standardized distance any one value can have from that sample's mean is √(N−1).
At period 5, the ceiling is √4 = 2σ. Because this test requires a close to be strictly outside the band, period 5 and 2σ cannot trigger. The result was zero trades in all 12 combinations of three timeframes and four windows.
Period and deviation are therefore not independent knobs. A short enough period paired with a distant enough band can be an impossible setting, not merely an unprofitable one.
Bollinger Bands period settings and signals
MT4 and MT5 place Bollinger Bands under Insert → Indicators → Trend. TradingView and Formiq expose the same core inputs.
| Field | Conventional value | What it controls |
|---|---|---|
| Period / Length | 20 | Number of prices in the mean and standard deviation |
| Shift / Offset | 0 | Horizontal displacement of all three lines |
| Deviations / StdDev | 2.000 | Multiple of standard deviation above and below the mean |
| Apply to / Source | Close | Price used in the calculation; this test uses closes |
| Style / Color | Any | Display only; it does not affect the calculation |
A shorter period follows price faster and creates more signals. A longer one smooths the line and tends to lengthen trades. Deviation moves the two outer bands nearer to or farther from the mean while holding the period fixed.
This study measured three trading interpretations.
| System | Entry | Exit |
|---|---|---|
| Fade long | Buy the close when the low touches the lower band | Close when the opposite 1σ band is touched |
| Fade short | Sell the close when the high touches the upper band | Close when the opposite 1σ band is touched |
| Breakout | Buy a close above the upper band and sell a close below the lower band | Reverse on an opposite close |
The earlier deviation study found that 0.5σ through 1.25σ survived changes of year and period, with many 2σ settings surviving as well. This period test gives the seven values from 0.5σ through 2σ equal weight so that a handful of distant-band trades cannot choose the winning lookback.
How this was measured
| Item | Value |
|---|---|
| Pair | USD/JPY |
| Windows | Calendar 2025, calendar 2024, and the two halves of 2025 |
| Timeframes | 15-minute / one-hour / four-hour |
| 2025 bars | 24,903 M15, 6,226 H1, 1,610 H4 |
| Periods | 5, 10, 14, 20, 25, 30, 40, 50, 75, 100, 150, 200 |
| Deviations | 0.5σ, 0.75σ, 1σ, 1.25σ, 1.5σ, 1.75σ, 2σ |
| Grid | 12 periods × 7 deviations × 3 systems = 252 settings, on 3 timeframes and 4 windows: 3,024 runs |
| Costs | 0.3-pip spread, zero slippage, 0.1 lots |
| Fills | Signal-bar close; exit and reversal on the same bar |
| Stops and targets | None in the main grid; added separately below |
| Measurement | Formiq's production backtester, with pips re-derived from every fill |
Each period is judged by the mean of its seven deviations and by how many of those deviations were profitable in both calendar years.
The winning bar count changed with timeframe
These are the periods with the highest two-year deviation mean for the breakout.
| Timeframe | Leading period | Elapsed time | 2025 mean | 2024 mean | Positive both | Mean 2025 trades |
|---|---|---|---|---|---|---|
| 15-minute | 50 | 12.5 hours | +1,368.1 | +1,656.0 | 6 / 7 | 463.0 |
| One-hour | 20 | 20 hours | +1,067.1 | +2,058.3 | 7 / 7 | 245.6 |
| Four-hour | 5 | 20 hours | +1,260.0 | +1,470.4 | 6 / 6 | 173.1 |
Period 5 has only six active deviations because its 2σ breakout is impossible. Across all 84 settings, 59 M15, 53 H1 and 26 H4 settings were profitable in both years.
The three winners do not support a universal period of 20. They support a more limited observation: the best lookbacks in this grid clustered from half a day to roughly one day.
Period 20 led the hourly two-year mean
The hourly breakout provides the largest common sample for comparing all 12 periods. Each row below averages seven deviations.
| Period | 2025 mean | 2024 mean | Two-year mean | Mean 2025 trades | Positive both |
|---|---|---|---|---|---|
| 5 | +1,174.4 | +1,211.6 | +1,193.0 | 692.7 | 6 / 6 |
| 10 | +1,560.6 | +665.4 | +1,113.0 | 437.3 | 6 / 7 |
| 14 | +1,405.8 | +1,165.9 | +1,285.8 | 329.9 | 6 / 7 |
| 20 | +1,067.1 | +2,058.3 | +1,562.7 | 245.6 | 7 / 7 |
| 25 | +799.2 | +885.8 | +842.5 | 203.4 | 6 / 7 |
| 30 | +1,427.1 | +562.1 | +994.6 | 169.0 | 6 / 7 |
| 40 | +1,161.1 | +889.6 | +1,025.3 | 127.6 | 7 / 7 |
| 50 | +1,040.7 | +1,103.8 | +1,072.3 | 104.1 | 6 / 7 |
| 75 | −494.3 | +1,905.9 | +705.8 | 78.6 | 2 / 7 |
| 100 | −1,092.3 | +1,957.2 | +432.5 | 63.3 | 1 / 7 |
| 150 | −1,910.7 | +2,109.6 | +99.4 | 47.7 | 0 / 7 |
| 200 | −2,022.6 | +1,663.4 | −179.6 | 38.3 | 0 / 7 |
Period 20 had both the highest two-year mean and seven of seven deviations positive in both years. Period 40 also retained seven, but its two-year mean was +1,025.3 pips. If one hourly value has to be the starting point, 20 has the best support in this sample.
Periods 75 and above tell a cautionary story. They profited strongly in 2024 and lost in 2025, while averaging only 38 to 79 annual trades. The long period did not simply remove noise; a few extended moves came to dominate its result.
Where the default 20 and 2σ landed
| Year | Trades | Win rate | PF | Net pips | Rank of 84 |
|---|---|---|---|---|---|
| 2025 | 132 | 43.18% | 1.235 | +1,177.5 | 27 |
| 2024 | 137 | 41.61% | 1.270 | +1,434.6 | 40 |
The conventional setting was profitable in both years and above the median, but it did not lead either one. A defensible period does not make its conventional deviation automatically optimal. With period 20 and 1σ, the same system took 277 trades and made +1,052.5 pips in 2025, then 280 and +2,071.7 in 2024.
Each year's winner fell to eleventh in the other year
The rank correlation between the 12 hourly periods was −0.678 across calendar years.
- Period 10 led 2025 at +1,560.6 pips but ranked 11th in 2024 at +665.4
- Period 150 led 2024 at +2,109.6 pips but ranked 11th in 2025 at −1,910.7
Optimizing period and deviation together was still less portable.
| Selection | Setting | Selection year | Other year | Rank in other year |
|---|---|---|---|---|
| Best in 2025 | Period 10, 1.75σ | +2,753.0 pips, 271 trades | 2024 +686.0 | 65 / 84 |
| Best in 2024 | Period 150, 0.5σ | +3,164.9 pips, 53 trades | 2025 −1,772.1 | 74 / 84 |
Choosing the single largest historical cell is therefore hard to defend. Period 20 is a better baseline because nearby deviations survived both years, not because its best cell topped the table.
Period 20 still failed the half-year check
Splitting 2025 changes which definition of “best” wins.
| Period | First-half mean | Second-half mean | Positive in both halves |
|---|---|---|---|
| 10 | +745.8 | +788.9 | 7 / 7 |
| 14 | +779.2 | +603.3 | 5 / 7 |
| 20 | −211.0 | +1,258.5 | 2 / 7 |
| 40 | +227.8 | +916.3 | 6 / 7 |
| 50 | +596.3 | +448.2 | 6 / 7 |
All seven period-20 deviations were positive in both calendar years, yet only two were positive in both halves of 2025. Period 10 retained seven of seven; periods 40 and 50 retained six.
The highest two-year profit and the most stable half-year result are different objectives. Use 20 as the hourly annual baseline, but put 10, 40 and 50 beside it when shorter-window stability matters.
Win rate explained one year, not the next
The 83 active hourly breakout settings in 2025 averaged 214 trades, from 19 to 1,258. Their mean win rate was 36.3%, mean winner +112.8 pips and mean loser −67.9 pips.
Win rate and profit had a +0.776 rank correlation inside 2025. That relationship describes the completed year, but it did not preserve period order into 2024: the period rank correlation was −0.678. A win rate can explain the current result without selecting next year's lookback.
The fade led elsewhere. Only 10 of 84 hourly fade-long settings and none of the 84 fade-short settings were profitable in both years. A period chosen for the breakout cannot be carried over to mean reversion without retesting the direction.
Filters, exits and costs did not change the period answer
We used the hourly period 20 and 1σ breakout as a baseline, then changed one practical condition at a time. Each cell is trades and annual net pips.
| Condition | 2025 | 2024 |
|---|---|---|
| Plain | 277, +1,052.5 | 280, +2,071.7 |
| ADX ≥ 20 | 188, −1,033.2 | 185, −3.9 |
| Tokyo hours | 164, +519.4 | 162, +2,139.6 |
| London and New York hours | 207, +1,073.5 | 218, +2,154.3 |
| SL 30 / TP 60 | 398, +1,634.1 | 419, +1,415.4 |
| SL 50 / TP 100 | 323, +1,131.1 | 345, +1,868.3 |
| SL 100 / TP 200 | 297, +1,333.9 | 292, +1,980.6 |
| 24-bar time exit | 334, +989.1 | 337, +1,559.0 |
ADX thresholds of 20, 25 and 30 all trailed the plain system. London and New York hours improved it slightly in both years, but not by enough to replace the period conclusion. No fixed stop-and-target combination beat the plain exit in both years.
The 277 signals stayed fixed while spread changed. Net profit was +1,135.6 pips at zero spread, +1,052.5 at 0.3, +858.6 at 1, +581.6 at 2 and +304.6 at 3 pips. The simple break-even spread was 4.1 pips. Shortening period increases frequency, so costs need to be checked again rather than borrowed from period 20.
What this test supports
- There is no universal best bar count. The two-year winners were period 50 on M15, 20 on H1 and 5 on H4
- Those winners covered similar elapsed time. Their lookbacks clustered from 12.5 to 20 hours, making horizon more informative than the raw count
- Period 20 is the hourly starting point. Its seven-deviation mean was +1,562.7 pips across the two years, and every deviation was positive in both
- Do not adopt a single-year winner. Period 10 in 2025 and period 150 in 2024 each fell to 11th in the other year
- Compare adjacent horizons. Periods 10, 40 and 50 were steadier than 20 across the two halves, so annual profit is not the only criterion
Related tests
Which Bollinger Bands standard deviation works best? holds the period range tighter and compares 0.5σ through 4σ. 315 Bollinger Band backtests broadens the entry and exit combinations.
Moving-average crossover settings show how period affects two lines, while SMA versus EMA isolates the averaging method at the same period. Backtesting without code shows how to rebuild these conditions on another pair.
Limits of this test
- One pair and two calendar years. USD/JPY rose 1,632.5 pips in 2024 and finished 55.7 pips lower in 2025, so the regime changed materially
- The best period changed by timeframe and cannot be assumed to transfer to another pair or to daily bars
- Selecting from 12 periods and seven deviations creates multiple-comparison uplift. The opposite year is a check, not untouched future data
- Period 5 and 2σ is impossible under this population-standard-deviation implementation. A sample deviation or a calculation that excludes the current close changes the boundary
- Touches use highs and lows; breakouts use closes. A fade may exit and re-evaluate an entry at the same close when one bar touches both sides
- Fills use bar closes and a fixed spread. Changing spreads, limit-order slippage and intrabar path are not reproduced
- An open position is closed at the final bar of each window, so the two half-year results do not add exactly to the calendar-year result
Questions people ask
- What is the best period for Bollinger Bands?
- There was no universal best bar count in this USD/JPY test. Averaging seven breakout deviations across 2024 and 2025, period 50 led the 15-minute chart, period 20 led the hourly chart and period 5 led the four-hour chart. Those different counts represent similar lookbacks of 12.5 to 20 hours.
- Is the default Bollinger Bands period of 20 good?
- It was a sound hourly starting point. Period 20 had the highest two-year mean at +1,562.7 pips, and all seven deviations were profitable in both 2024 and 2025. It was less stable across shorter windows: its seven-deviation mean was −211.0 pips in the first half of 2025, and only two deviations were positive in both halves.
- What happens when the Bollinger Bands period is increased?
- The lines react more slowly and signals become less frequent. On hourly USD/JPY in 2025 at 1σ, mean half-width rose from 12.79 pips at period 5 to 88.68 at period 200, while annual breakout trades fell from 934 to 46. The share of closes inside the bands did not rise consistently.
- Why did period 5 and 2σ produce no breakouts?
- When the current close is included in an N-value population standard deviation, one observation cannot be more than √(N−1) standard deviations from the mean. At period 5 the ceiling is exactly 2σ, so a strict close above or below the 2σ band is impossible. All 12 timeframe-and-window cells recorded zero trades.
- Can I change the Bollinger Bands period in MT4 or TradingView?
- Yes. MT4 and MT5 expose it as Period in the Bollinger Bands dialog, with 20 as the conventional default. TradingView and Formiq have the corresponding Length or Period input. Period, deviation and applied price affect the calculation; colour and line style do not.
Formiq is a free browser-based FX terminal with replay practice and no-code backtesting. Open the chart or see what the free plan includes.