bbpercent
%B (percent b)
Reference/Bands & channels/Function
bbpercent(source, length, mult)
Where close sits inside the Bollinger envelope: 1 at the upper band, 0 at the lower. Alias: percentb. Short form `bbpercent(20)` uses close.
Parameters
| Name | Type | Description |
|---|---|---|
sourceoptional | series default close | Series to use. Omit it when the first argument is a number — ema(9) means ema(close, 9). |
length | int default 20 | Lookback in bars. Default 20. |
multoptional | float default 2 | Band width. |
Return value
series
Short form: if the first argument is a number, Dovee uses close as the source.
Also accepted: percentb.
Example
oscillator p = bbpercent(20) plot p as "%B" level 1 as "Upper" red level 0 as "Lower" green