Categories

Plombiers is a polynomial regression channel for MetaTrader 5 that fits a least-squares curve through recent price action and wraps it in two different sets of deviation bands, with an optional stochastic-based oscillator layered directly on top of the channel. It’s a free instant download, and because the entire channel recalculates on every incoming tick, it’s best treated as a visual, statistics-driven study of where price sits relative to its recent trend rather than a fixed support/resistance tool.
What Plombiers Actually Calculates
At its core, Plombiers solves a least-squares regression over a rolling window of bars_IN bars (145 by default), offset by N_Shift1. The order of the fitted curve is controlled by the SP input: 0 produces a simple average, 1 a straight line, 2 a second-degree parabola (the default), 3 a third-degree curve, and 4 a fourth-degree curve. The coefficients are solved with Gaussian elimination and partial pivoting directly in the code (the ai/b/x matrix routine), and the resulting fitted values become the solid blue Means line plotted on the chart.
Two separate measures of dispersion are then built around that fitted line. The first is a residual-based deviation: the sum of squared differences between actual price and the fitted Means value, divided by the sample size, square-rooted, and multiplied by the kstd input (2.1415 by default). This produces the solid green Resistance/Support bands. The second is an independent standard deviation of raw closing price itself (computed in the custom myStdDev() function), also scaled by kstd, producing the dashed light-blue Resistance+/Support- bands. Because these two calculations use different inputs (regression residuals vs. raw price spread), the two band pairs will rarely sit at the same distance from the Means line.
If the Oscilator input is left at its default true, the indicator also pulls in a standard Stochastic Oscillator (built with the Ka, La, Za, Oe, and Me inputs) and rescales its 0–100 output onto the price scale using the channel’s own residual-based deviation, plotting it as the dotted Signal line that oscillates inside and around the channel bands rather than in its own subwindow.
How to Read the Channel
The Means line represents the statistically fitted center of the recent trend at the chosen polynomial order. Price pushing into or through the solid green bands suggests it has moved further from the fitted trend than its own regression residuals would typically allow; the dashed light-blue bands offer a second, independently-scaled reference using plain price volatility instead of residuals. The dotted Signal line gives a stochastic-style overbought/oversold read, but mapped onto the price axis so it visually tracks alongside the bands instead of in a separate oscillator window. Many users watch for the Signal line reaching its scaled extremes at the same time price is testing one of the outer bands as a confluence read, rather than trading either element in isolation.
Key Input Parameters
- bars_IN (145): number of bars used for the regression fit.
- SP (i2 – 2nd degree): polynomial order of the fitted curve, from a simple average up to a 4th-degree curve.
- N_Shift1 (0): shifts the regression window back into history.
- Forecast (0): extends the fitted channel forward into unformed bars.
- kstd (2.1415): multiplier applied to both deviation calculations.
- Oscilator (true): toggles the embedded stochastic Signal line.
- N_Buff (1): which internal Stochastic buffer is read.
- Ka (21), La (7), Za (1): %K period, %D period, and slowing for the internal Stochastic.
- Oe (MODE_SMA), Me (STO_CLOSECLOSE): averaging method and price mode for the internal Stochastic.
- DIGf (-99): decimal rounding for plotted values; -99 uses the chart’s own digit setting.
Honest Limitations
Because the fit is recalculated across the full bars_IN window on every tick, every line Plombiers draws — the Means, both sets of bands, and the Signal line — is subject to change as new bars form. This makes it unsuitable as a mechanical entry trigger; it’s a visual regression study, not a signal generator, and it carries no alerts or arrow objects. Setting SP to 3 or 4 lets the curve fit noise rather than genuine trend, and a nonzero Forecast value projects the channel into bars that don’t exist yet, which should be read as an extrapolation, not a prediction. The code itself places no restriction on symbol or timeframe, so it can technically be attached anywhere, but its behavior was only ever validated by its original author for general chart analysis.
- bars_IN (default 145) — Number of bars used as the data length for the regression fit.
- SP (default i2 (2nd degree parabola)) — Order of the least-squares curve: 0=simple average, 1=straight line, 2=parabola, 3=3rd degree, 4=4th degree.
- N_Shift1 (default 0) — Shifts the regression window back into history.
- Forecast (default 0) — Length of the channel projected forward into the future.
- kstd (default 2.1415) — Standard deviation multiplier applied to both band calculations.
- Oscilator (default true) — Toggles display of the embedded stochastic-based Signal line.
- N_Buff (default 1) — Which buffer of the internal Stochastic indicator is read.
- Ka (default 21) — %K calculation period for the internal Stochastic.
- La (default 7) — %D averaging period for the internal Stochastic.
- Za (default 1) — Slowing/deceleration for the internal Stochastic.
- Oe (default MODE_SMA) — Averaging method used by the internal Stochastic.
- Me (default STO_CLOSECLOSE) — Price value used by the internal Stochastic.
- DIGf (default -99) — Decimal points for rounding output values; -99 uses the chart's Digits().
FAQs About the MT4 Plombiers Indicator MT5
Does Plombiers repaint?
Yes. Every OnCalculate pass refits the regression across the entire bars_IN window and rewrites the Means line, both sets of bands, and the Signal line for every bar in that window, so values already displayed will change as new price data arrives.
What does the SP input actually change?
SP sets the order of the polynomial used in the least-squares fit: 0 is a simple average, 1 a straight line, 2 a second-degree parabola (default), and 3 or 4 progressively more flexible (and more overfit-prone) curves.
Why are there two sets of channel bands?
The solid green bands are scaled from the regression’s own residuals (how far actual price deviates from the fitted Means line), while the dashed light-blue bands use a separate raw standard deviation of price itself, computed independently in the myStdDev() function.
What is the dotted Signal line?
It’s a standard Stochastic Oscillator (configured via the Ka, La, Za, Oe, and Me inputs) whose 0–100 output is rescaled onto the price axis using the channel’s own deviation, so it plots inside/around the bands instead of in a separate window.
Does the code restrict which symbols or timeframes it works on?
No restriction is coded — bars_IN and N_Shift1 are simple bar counts that adapt to whatever chart it’s attached to, though the original author did not document a specific intended timeframe or instrument.
Plombiers Indicator MT5
Plombiers is a polynomial regression channel for MetaTrader 5 that fits a least-squares curve through recent price action and wraps it in two different sets of deviation bands, with an optional stochastic-based oscillator layered directly on top of the channel. It's a free instant download, and because the entire channel recalculates on every incoming tick,…
Download the Plombiers Indicator MT5