Bollinger Bands
Bollinger Bands wrap a moving average in two bands set a number of standard deviations away, so the channel widens when the market is volatile and contracts when it is quiet. They turn volatility into something you can compare across instruments and wire straight into a no-code EA.
- Default settings
- 20 / 2
- Bands
- Upper / Base / Lower
- Scale
- Price
示意性 — 合成資料,非即時報價。
What Bollinger Bands tell you
The bands measure how far price has strayed from its own recent average, in units of that average's own volatility. That makes an extreme on EUR/USD directly comparable to an extreme on gold — and it makes the width of the channel a reading in its own right.
- Wide bands: volatility is high — moves are running
- Narrow bands: volatility is compressed — a move is being stored, not predicted
- A touch is a statement about distance from the average, not a reversal signal
- 1 Average the applied price over N bars
- 2 Measure the deviation of the same window
- 3 Place bands a multiple of it above and below
顯示公式與計算詳情
Bollinger Bands are built from a moving average and the standard deviation of the same window — 20 bars and 2 deviations by default:
- Compute the middle band: a simple moving average of the applied price over the period. In MT5 this is
BASE_LINE, buffer 0. - Compute the standard deviation of the applied price over the same window — a measure of how widely the individual prices are scattered around that average.
- Place the outer bands a multiple of that deviation above and below:
UPPER = BASE + (D × σ)andLOWER = BASE − (D × σ), withDthe deviation setting.
Because the distance is measured in the instrument’s own volatility, the channel adapts automatically: it widens when bars are large and contracts when they are small. That is also why a band touch is not a fixed distance — the same touch means something different in a quiet session than in a violent one.
In MQL5 the call is iBands(symbol, period, bands_period, bands_shift, deviation, applied_price) and it returns a handle to three buffers: BASE_LINE (0), UPPER_BAND (1) and LOWER_BAND (2). applied_price is a full ENUM_APPLIED_PRICE argument, so the bands are not fixed to closing prices. John Bollinger introduced the construction in the early 1980s.
訊號
Bollinger Bands 提供的可回測訊號 — 及每個訊號適合的市場狀態。
Squeeze
進階邏輯Middle-Band Cross
Builder 可實現Band Walk
進階邏輯MT5 實作
MetaTrader 5 實際計算與繪製的內容——本頁每條規則的依據。
緩衝區
| 索引 | 緩衝區 | MT5 中的繪製方式 | 存放內容 |
|---|---|---|---|
| 0 | BASE_LINE | Line | The middle band — a simple moving average of the applied price over the chosen period. Everything else is measured from it. |
| 1 | UPPER_BAND | Line | Middle band plus the deviation multiplier times the standard deviation of the same window. |
| 2 | LOWER_BAND | Line | Middle band minus the same distance. Upper and lower are always symmetric around the base line. |
平台說明
最佳適用場景 / 謹慎使用
沒有任何指標具有普適優勢。以下是 Bollinger Bands 發揮作用的場景 — 以及可能誤導的場景。
最佳適用場景
- Ranging markets
- Comparing volatility across instruments
- With a trend or momentum filter
- On liquid pairs with steady sessions
謹慎使用
- Strong one-way trends
- Band touches as standalone entries
- Very tight deviation settings
- Optimised width without validation
構建 Bollinger Bands 策略
將訊號接入進場和出場規則,然後匯出可編譯的 MT5 EA — 無需撰寫程式碼。
- Lower band (20, 2.0)
- Upper band (20, 2.0)
- Bid at or below lower band → Open Buy · SL 40 / TP 80
- Bid at or above upper band → Open Sell
將 Bollinger Bands 與其他指標組合
單一指標很少獨立有效。這些組合彌補了 Bollinger Bands 的盲點。
Bollinger Bands + OBV
- Price crosses the upper band
- OBV above its value 20 bars ago
- Buy
Bollinger Bands + Stochastic
- Bid at or below lower band
- Stochastic %K < 20
- Buy
Bollinger Bands + RSI
- Price at lower band
- RSI < 30
- Buy
No single-flow template pairs Bollinger Bands with RSI — the Bollinger Bounce template trades band touches only, despite what its description says. Add an RSI node and a Compare to it.
開啟 Builder →Bollinger Bands + ADX
- ADX < 20
- Price at lower band
- Buy
No single-flow template pairs Bollinger Bands with ADX. Add an ADX node with a Compare below 20 into an And gate ahead of the entry.
開啟 Builder →Bollinger Bands + Donchian Channel
- Price crosses the upper band
- Price clears the 20-bar high
- Buy
No single-flow template combines them. Start from Donchian 20-Bar Break, add a Bollinger node set to the upper output with a Price node into a Compare, then join that to the existing Cross with an And gate.
開啟 Builder →參數
在您自己的貨幣對和時間框架上驗證的起始值 — 非保證設置。
| 參數 | 預設值 | 建議測試範圍 | 功能說明 |
|---|---|---|---|
| Period | 20 | 10–50 | Window for both the middle-band average and the deviation. Shorter bands hug price and touch constantly; longer bands only flag real extremes. |
| Deviation | 2 | 1.5–3.0 | How many standard deviations the outer bands sit from the base line. Lower means more touches and more false ones; higher means rarer, more meaningful stretches. |
| Applied price | Close | Close / Open / High / Low / Median / Typical / Weighted | Price series the average and deviation are computed on. Close is the default; iBands accepts any ENUM_APPLIED_PRICE value. |
| Band | Lower / Upper | — | Which buffer a rule reads: BASE_LINE, UPPER_BAND or LOWER_BAND. This is a buffer selector, not a numeric setting. |
初始預設
市場示例
Bollinger Bands 有效的場景、失效的場景,以及篩選器如何改變結果。
Fade that worked
In a range price stretches to the lower band, stalls, and returns to the middle band — the mean-reversion case the bands describe.
Band walk in a trend
In a strong move price rides the upper band for bar after bar. Selling each touch fights the trend and pays for the privilege.
Filtered by regime
Add a trend-strength filter and the same run of upper-band touches is ignored while the move continues — the filter decides whether a touch is an extreme or just a trend.
FAQ
- Does a touch of the upper band mean sell?
- No. A touch means price is two standard deviations from its own 20-bar average — in a range that is stretched, in a trend it is normal and can persist for weeks. Use the touch as context and confirm with momentum, structure, or a regime filter before acting.
- What is a Bollinger squeeze?
- A local minimum in the distance between the two outer bands, meaning realised volatility has compressed. It says a move is being stored, not which way it will break. Because iBands has no band-width buffer, an EA has to compute upper minus lower itself, or use Standard Deviation as a stand-in.
- Should I change the period or the deviation?
- They do different things. The period sets what counts as 'the average' and how fast the channel adapts; the deviation sets how far price must travel to be called extreme. Change one at a time in a backtest — moving both at once makes the result impossible to attribute.
- Can Bollinger Bands be built on a price other than the close?
- Yes. iBands takes an ENUM_APPLIED_PRICE argument, so the bands can be built from Open, High, Low, Median, Typical or Weighted price. Close is the default and the usual choice; Typical price folds in the bar's range and gives a marginally steadier channel on wick-heavy instruments.
- Can I build a Bollinger EA without coding?
- Yes for band touches and middle-band crosses. The Bollinger Bounce template wires two band nodes against a Price node with period, deviation and applied price as EA inputs. Squeeze detection and band-walk recognition are the exceptions — both need a value iBands does not publish.
- How should I validate settings before going live?
- Backtest on quality tick data first, then run the EA on a demo account before risking money. When optimising, hold back data the search never saw and prefer settings that stay profitable across periods over the single in-sample peak — chasing that peak is overfitting the noise. No default or preset here is a performance promise; every value is a starting point to re-validate on your own pair and broker.