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:
Miha Kralj
2026-03-10 18:38:23 -07:00
parent 8906c62dcf
commit 35a6702b06
178 changed files with 2579 additions and 998 deletions
+1 -3
View File
@@ -9,8 +9,6 @@ indicator("Chaikin A/D Oscillator (ADOSC)", "ADOSC", overlay=false)
//@returns (float) The ADOSC value for the current bar (difference between short and long EMAs of ADL)
adosc(simple int shortPeriod, simple int longPeriod) =>
float EPSILON = 1e-10
if shortPeriod <= 0 or longPeriod <= 0
runtime.error("Periods must be greater than 0")
short_alpha = 2.0 / (shortPeriod + 1)
long_alpha = 2.0 / (longPeriod + 1)
one_minus_long_alpha = 1.0 - long_alpha
@@ -36,4 +34,4 @@ longPeriod = input.int(10, "Long Period", minval=1)
osc = adosc(shortPeriod, longPeriod)
// ---------- Plotting ----------
plot(osc, "ADOSC", color.new(color.yellow, 0, color=color.yellow, linewidth=2), linewidth=2)
plot(osc, "ADOSC", color=color.yellow, linewidth=2)
+3 -3
View File
@@ -25,7 +25,7 @@ aobv(src, vol) =>
resArr = array.new_float(2, na)
for i = 0 to array.size(periods) - 1
period = array.get(periods, i)
alpha = 2.0 / math.max(period, 1)
alpha = 2.0 / (period + 1)
beta = array.get(betaArr, i)
if beta == 0.0
beta := 1.0 - alpha
@@ -50,8 +50,8 @@ aobv(src, vol) =>
[array.get(resArr, 0), array.get(resArr, 1)]
// ---------- Inputs ----------
src = input(close, "Source")
vol = input(volume, "Volume")
src = input.source(close, "Source")
vol = input.source(volume, "Volume")
// ---------- Calculations ----------
[aobvFast, aobvSlow] = aobv(src, vol)
-4
View File
@@ -11,10 +11,6 @@ indicator("Chaikin Money Flow (CMF)", "CMF", overlay=false)
//@param src_vol The volume (default: built-in volume)
//@returns float CMF value between -1 and 1
cmf(len = 20, src_high = high, src_low = low, src_close = close, src_vol = volume) =>
// Validate parameters
if len < 1
runtime.error("Length must be >= 1")
// Calculate Money Flow Multiplier
float mfm = 0.0
if not na(src_high) and not na(src_low) and not na(src_close)
-2
View File
@@ -9,8 +9,6 @@ indicator("Elder's Force Index (EFI)", "EFI", overlay=false)
//@param src_vol The volume (default: built-in volume)
//@returns float The smoothed Force Index value
efi(len = 13, src = close, src_vol = volume) =>
if len < 1
runtime.error("Length must be >= 1")
var float prev_src = src
float raw_force = (nz(src) - nz(prev_src)) * nz(src_vol)
prev_src := src
-2
View File
@@ -9,8 +9,6 @@ indicator("Ease of Movement (EOM)", "EOM", overlay=false)
//@returns float Ease of Movement value
//@optimized for performance and dirty data
eom(i_smoothing, i_vol_scale, i_high=high, i_low=low, i_volume=volume) =>
if i_smoothing < 1 or i_vol_scale <= 0
runtime.error("Smoothing or Volume scale out or range")
var float oldMidPoint = na
midPoint = (i_high + i_low) * 0.5
midPointChange = midPoint - nz(oldMidPoint, midPoint)
-2
View File
@@ -10,8 +10,6 @@ indicator("Elastic Volume Weighted Moving Average (EVWMA)", "EVWMA", overlay=tru
//@returns EVWMA value where high-volume bars get more weight (faster response)
//@optimized O(1) per bar via circular buffer for running volume sum
evwma(series float src, series float vol, simple int period) =>
if period <= 0
runtime.error("Period must be greater than 0")
var int p = math.max(1, period), var int head = 0, var int count = 0
var array<float> vol_buffer = array.new_float(p, 0.0)
var float sum_vol = 0.0
+1 -1
View File
@@ -28,7 +28,7 @@ iii(simple int period, simple bool cumulative=false, series float h=high, series
valid_count := not na(raw_iii) ? valid_count + 1 : valid_count
array.set(buffer, head, raw_iii)
head := (head + 1) % period
smoothed_iii = sum / period
smoothed_iii = valid_count > 0 ? sum / valid_count : 0.0
cumulative_value := cumulative_value + raw_iii
cumulative ? cumulative_value : smoothed_iii
-2
View File
@@ -12,8 +12,6 @@ indicator("Money Flow Index (MFI)", "MFI", overlay=false)
//@returns float The MFI value (0-100)
//@optimized Uses circular buffers for O(1) performance with proper NA handling
mfi(simple int len, series float src_high=high, series float src_low=low, series float src_close=close, series float src_vol=volume) =>
if len < 1
runtime.error("Invalid parameter: len must be >= 1")
float typical_price = (src_high + src_low + src_close) / 3.0
float raw_money_flow = typical_price * nz(src_vol, 0.0)
float prev_typical_price = nz(typical_price[1], typical_price)
-2
View File
@@ -12,8 +12,6 @@ indicator("Price Volume Divergence (PVD)", "PVD", overlay=false)
//@returns Smoothed divergence value
//@optimized for performance and dirty data
pvd(simple int price_period, simple int volume_period, simple int smoothing_period, series float c=close, series float vol=volume ) =>
if smoothing_period <= 0
runtime.error("Smoothing period must be greater than 0")
float close_price = nz(c, close)
float volume_val = math.max(nz(vol, 0.0), 1.0)
float prev_close = bar_index < price_period ? close_price[math.max(bar_index, 1)] : close_price[price_period]
-4
View File
@@ -11,10 +11,6 @@ indicator("Percentage Volume Oscillator (PVO)", "PVO", overlay=false)
//@returns tuple with [pvo, signal, histogram] values
//@optimized Beta precomputation for EMA warmup compensation
pvo(series float vol, simple int fast_period, simple int slow_period, simple int signal_period) =>
if fast_period <= 0 or slow_period <= 0 or signal_period <= 0
runtime.error("All periods must be greater than 0")
if fast_period >= slow_period
runtime.error("Fast period must be less than slow period")
float vol_val = nz(vol, 0.0)
float fast_alpha = 2.0 / (fast_period + 1)
float slow_alpha = 2.0 / (slow_period + 1)
+1 -1
View File
@@ -22,4 +22,4 @@ i_price_source = input.source(close, "Price Source")
pvr_value = pvr(i_price_source)
// Plot
plot(pvr_value, "PVR", color=color.yellow, linewidth=2, plot.style_stepline)
plot(pvr_value, "PVR", color=color.yellow, linewidth=2, style=plot.style_stepline)
-2
View File
@@ -11,8 +11,6 @@ indicator("Volume Oscillator (VO)", "VO", overlay=false)
//@returns Volume Oscillator value
//@optimized for performance and dirty data
vo(simple int short_period, simple int long_period, simple int signal_period, series float vol=volume) =>
if short_period >= long_period
runtime.error("Short period must be less than long period")
volume_val = math.max(nz(vol, 0.0), 1.0)
var p_short = short_period
var buffer_short = array.new_float(p_short, na)
-3
View File
@@ -10,9 +10,6 @@ indicator("Volume Rate of Change (VROC)", "VROC", overlay=false)
//@returns Volume Rate of Change value
//@optimized for performance and dirty data
vroc(simple int period, simple bool calc_type, series float vol = volume) =>
if period <= 0
runtime.error("Period must be greater than 0")
float current_volume = vol
float historical_volume = vol[period]
if na(current_volume) or na(historical_volume)
-2
View File
@@ -12,8 +12,6 @@ indicator("Volume Weighted Accumulation/Distribution (VWAD)", "VWAD", overlay=fa
//@returns VWAD value representing volume-weighted accumulation/distribution
//@optimized for performance and dirty data
vwad(simple int period, series float src_high = high, series float src_low = low, series float src_close = close, series float src_vol = volume) =>
if period <= 0
runtime.error("Period must be greater than 0")
var int p = math.max(1, period), var int head = 0
var array<float> vol_buffer = array.new_float(p, na)
var float sum_vol = 0.0
-2
View File
@@ -10,8 +10,6 @@ indicator("Volume Weighted Moving Average (VWMA)", "VWMA", overlay=true)
//@returns VWMA value representing volume-weighted moving average
//@optimized for performance and dirty data
vwma(series float src, series float vol, simple int period) =>
if period <= 0
runtime.error("Period must be greater than 0")
var int p = math.max(1, period), var int head = 0, var int count = 0
var array<float> price_buffer = array.new_float(p, na)
var array<float> vol_buffer = array.new_float(p, na)