Standard Deviation
Standard Deviation measures how widely price is scattered around its own moving average — the raw dispersion figure that Bollinger Bands are built from. On its own it is the cleanest way to ask whether a market is expanding or contracting, with no direction attached.
- Template period
- 20
- Direction
- None
- Units
- Price
Illustrativ — synthetische Daten, kein Live-Kurs.
What Standard Deviation tells you
Standard Deviation answers how far, on average, price has been sitting from its own recent average. A rising value means the market is spreading out; a falling one means it is compressing. Like ATR it carries no direction — but unlike ATR it measures dispersion around a mean rather than distance travelled per bar.
- Rising: price is spreading away from its mean
- Falling: the market is compressing toward it
- Zero direction — expansion looks identical up or down
- 1 Average the applied price over N bars
- 2 Measure each bar's distance from that average
- 3 Take the root mean square of those distances
Formel und Berechnungsdetails anzeigen
Standard Deviation is the textbook dispersion statistic, computed on a rolling window:
- Compute a moving average of the applied price over the period, using the chosen method.
- For each bar in the window, take the difference between its price and that average, and square it.
- Average the squared differences and take the square root:
σ = √( Σ(Pᵢ − MA)² / N ).
Squaring in step 2 is what makes the result directionless — a price 10 points above the average and one 10 points below contribute identically. It also means large excursions dominate: doubling a single bar’s distance quadruples its contribution, so the reading responds sharply to one outsized bar and then decays as that bar leaves the window.
The output shares the instrument’s price units, which is both useful and limiting. Useful, because the number is directly comparable to a distance on the same chart. Limiting, because a threshold written for one symbol means nothing on another — which is why rules are almost always written as one deviation against another rather than against a fixed number.
In MQL5 the call is iStdDev(symbol, period, ma_period, ma_shift, ma_method, applied_price) and it returns a handle to a single buffer. Both ma_method and applied_price are real arguments, so the average the dispersion is measured around is as configurable as a standalone moving average.
Signale
Die eindeutigen, backtestbaren Signale, die StdDev liefert — und das passende Marktregime für jedes.
Expansion
Im Builder umsetzbarRegime Comparison
Fortgeschrittene LogikBand Width Proxy
Im Builder umsetzbarMT5-Implementierung
Was MetaTrader 5 tatsächlich berechnet und zeichnet — die Referenz für jede Regel auf dieser Seite.
Puffer
| Index | Puffer | Darstellung in MT5 | Inhalt |
|---|---|---|---|
| 0 | MAIN_LINE | Line | The standard deviation of the applied price around its own moving average, in price units. Always positive; it has no zero line and no upper bound. |
Plattform-Hinweise
Funktioniert am besten / mit Vorsicht verwenden
Kein Indikator hat einen universellen Vorteil. Hier hilft StdDev — und wo er irreführt.
Funktioniert am besten
- As a volatility filter
- Expressing squeeze rules
- Comparing regimes on one instrument
- Alongside a directional signal
Mit Vorsicht verwenden
- As a directional signal
- Comparing raw values across instruments
- Fixed price thresholds
- Very short periods on low timeframes
Eine StdDev-Strategie erstellen
Verbinden Sie das Signal mit Einstiegs- und Ausstiegsregeln und exportieren Sie dann einen kompilierbaren MT5 EA — ohne Code.
- Fast StdDev (10)
- Slow StdDev (40)
- Fast below slow — a quiet market
- MFI below 20 in a quiet market → Open Buy · SL 40 / TP 80
- MFI above 80 in a quiet market → Open Sell
StdDev mit anderen Indikatoren kombinieren
Ein einzelner Indikator reicht selten aus. Diese Paarungen decken die blinden Flecken von StdDev ab.
StdDev + MFI
- Fast StdDev below slow
- MFI below 20
- Buy
StdDev + Bollinger Bands
- StdDev at a local low
- Price at a band
- Wait for expansion
No single-flow template pairs Standard Deviation with Bollinger Bands. Start from Bollinger Bounce and add StdDev nodes with a Compare between a fast and a slow period.
Builder öffnen →StdDev + Moving Average
- Fast StdDev above slow
- Fast MA crosses slow
- Buy
No single-flow template pairs Standard Deviation with a moving average. Start from MA Crossover and add StdDev nodes with a Compare.
Builder öffnen →Parameter
Startwerte zur Validierung auf Ihrem eigenen Paar und Zeitrahmen — keine garantierten Einstellungen.
| Parameter | Standard | Empfohlener Testbereich | Was er tut |
|---|---|---|---|
| Period | 20 | 10–50 | Window for both the moving average and the dispersion measured around it. The template uses 10 and 40 as a fast/slow pair rather than a single value. |
| Method | SMA | SMA / EMA / SMMA / LWMA | How the underlying average is weighted. Changing it changes what the deviation is measured around, so it changes the output even at the same period. |
| Applied price | Close | Close / Open / High / Low / Median / Typical / Weighted | Price series the dispersion is computed on. iStdDev accepts any ENUM_APPLIED_PRICE value. |
| Shift | 0 | 0–3 | Which bar back the value is read from. Shift 1 compares against a fully closed bar. |
Start-Voreinstellungen
Marktbeispiele
Wo StdDev funktioniert, wo er scheitert und wie ein Filter das Ergebnis verändert.
Contraction permits the fade
The short-window deviation falls under the long one, the market is genuinely quiet, and a mean-reversion entry works as intended.
Fading into an expansion
The same oscillator extreme appears while dispersion is climbing. Price is spreading away from its mean, and the fade is standing in front of it.
Dispersion filter suppresses the trade
The directional signal fires but the fast deviation sits above the slow one, so the entry is skipped and the move continues without you.
Verwandte Indikatoren
FAQ
- Standard Deviation or ATR?
- They are different measurements that often agree. ATR averages the distance price travelled per bar and includes gaps; Standard Deviation measures how scattered prices are around their own average and ignores gaps entirely. Use ATR when you care about how much room a trade needs, and Standard Deviation when you care about whether the market is spreading out or compressing.
- Is this the same σ that Bollinger Bands use?
- Yes. Bollinger's outer bands are the middle band plus and minus a multiple of exactly this quantity, computed over the same window on the same applied price. That is why Standard Deviation is the practical way to write a squeeze rule — iBands publishes the three lines but not the width between them.
- Why is there no zero line?
- Because dispersion cannot be negative — the calculation squares each distance before averaging. The indicator is always at or above zero and has no upper bound, so rules are written as comparisons between two deviations or against the indicator's own recent range, never against a fixed centre.
- What period should I use?
- 20 matches the Bollinger default and is a sensible single-value starting point. In practice a fast/slow pair is more useful than any single number, because it removes the need for an instrument-specific threshold — the template uses 10 against 40 for exactly that reason.
- Can I build a Standard Deviation EA without coding?
- Yes, as a filter. The MFI + Standard Deviation template uses two StdDev nodes with different periods and a Compare between them to require a quiet market, with period, method and applied price exposed as EA inputs. Classifying volatility against its own long-run distribution is the exception and needs custom MQL5.
- 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.
Verwandte Artikel
Glossary