mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-18 18:48:05 +00:00
fix(docs): correct .md documentation across errors, dynamics, filters, forecasts, momentum, numerics, oscillators, reversals, statistics, trends, volatility, volume
Deep review of all indicator categories verified .md headers against .cs WarmupPeriod, parameters, inputs, and outputs. Fixes include warmup corrections, parameter documentation, output type accuracy, and Pine Script alignment.
This commit is contained in:
@@ -11,8 +11,6 @@ indicator("Bollinger Band Width Percentile (BBWP)", "BBWP", overlay=false, forma
|
||||
//@returns BBWP value representing current BBW percentile in historical range
|
||||
//@optimized for performance and dirty data
|
||||
bbwp(series float source, simple int period, simple float multiplier, simple int lookback) =>
|
||||
if period <= 0 or multiplier <= 0.0 or lookback <= 0
|
||||
runtime.error("Period, multiplier, and lookback must be greater than 0")
|
||||
var int p = math.max(1, period), var int head = 0, var int count = 0
|
||||
var array<float> buffer = array.new_float(p, na)
|
||||
var float sum = 0.0, var float sumSq = 0.0
|
||||
@@ -29,7 +27,7 @@ bbwp(series float source, simple int period, simple float multiplier, simple int
|
||||
head := (head + 1) % p
|
||||
float basis = nz(sum / count, source)
|
||||
float dev = count > 1 ? multiplier * math.sqrt(math.max(0.0, sumSq / count - basis * basis)) : 0.0
|
||||
float bbw = 2 * dev
|
||||
float bbw = basis != 0.0 ? 2 * dev / basis : 0.0
|
||||
var int l = math.max(1, lookback), var int hist_head = 0, var int hist_count = 0
|
||||
var array<float> hist_buffer = array.new_float(l, na)
|
||||
float hist_oldest = array.get(hist_buffer, hist_head)
|
||||
|
||||
Reference in New Issue
Block a user