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 -1
View File
@@ -5,7 +5,7 @@ using System.Runtime.InteropServices;
namespace QuanTAlib;
/// <summary>
/// AC: Acceleration Oscillator
/// AC: Accelerator Oscillator
/// </summary>
/// <remarks>
/// Bill Williams' Acceleration Oscillator measures the acceleration or deceleration
+1 -1
View File
@@ -1,4 +1,4 @@
# AC: Acceleration Oscillator
# AC: Accelerator Oscillator
> "Momentum tells you which way the wind is blowing. Acceleration tells you whether the wind is picking up." -- Bill Williams, paraphrased
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Bollinger %B", "BBB", overlay=false)
indicator("Bollinger %B (BBB)", "BBB", overlay=false)
//@function Calculates Bollinger Bands %B oscillator
//@param source Series to calculate %B from
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Chande Forecast Oscillator", "CFO", overlay=false)
indicator("Chande Forecast Oscillator (CFO)", "CFO", overlay=false)
//@function Chande Forecast Oscillator - measures percentage difference between price and forecasted price
//@param source Price data to analyze
+2 -2
View File
@@ -4,7 +4,7 @@
| ---------------- | -------------------------------- |
| **Category** | Oscillator |
| **Inputs** | Source (close) |
| **Parameters** | `longRoc` (default DefaultLongRoc), `shortRoc` (default DefaultShortRoc), `wmaPeriod` (default DefaultWmaPeriod) |
| **Parameters** | `longRoc` (default 14), `shortRoc` (default 11), `wmaPeriod` (default 10) |
| **Outputs** | Single series (Coppock) |
| **Output range** | Varies (see docs) |
| **Warmup** | 1 bar |
@@ -12,7 +12,7 @@
### TL;DR
- The Coppock Curve is a long-term momentum oscillator that applies a Weighted Moving Average to the sum of two Rate of Change calculations at differ...
- Parameterized by `longroc` (default defaultlongroc), `shortroc` (default defaultshortroc), `wmaperiod` (default defaultwmaperiod).
- Parameterized by `longRoc` (default 14), `shortRoc` (default 11), `wmaPeriod` (default 10).
- Output range: Varies (see docs).
- Requires 1 bar of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
+4 -3
View File
@@ -1,3 +1,6 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
// Fisher04: Ehlers Fisher Transform (2004 Cybernetic Analysis)
// Source: John Ehlers, "Cybernetic Analysis for Stocks and Futures", Wiley, 2004, Chapter 1
//
@@ -7,9 +10,7 @@
// Clamp threshold: 0.9999 vs 0.99→0.999
// Fisher multiplier: 0.25 vs 0.5
// Fisher IIR: 0.5 (same)
//@version=6
indicator("Fisher04 - Ehlers 2004 Cybernetic Analysis", shorttitle="Fisher04", overlay=false)
indicator("Ehlers Fisher Transform 2004 (FISHER04)", "FISHER04", overlay=false)
length = input.int(10, "Length", minval=1)
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Williams Gator Oscillator", "GATOR", overlay=false)
indicator("Williams Gator Oscillator (GATOR)", "GATOR", overlay=false)
//@function Calculates Williams Gator Oscillator from Alligator lines
//@param source Series to calculate from
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Inertia", "INERTIA", overlay=false)
indicator("Inertia Oscillator (INERTIA)", "INERTIA", overlay=false)
//@function Calculates Inertia oscillator measuring trend strength based on distance from linear regression
//@param source Source series to calculate Inertia for
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("KDJ", "KDJ", overlay=false)
indicator("KDJ Oscillator (KDJ)", "KDJ", overlay=false)
//@function Calculates KDJ (K, D, J) lines - enhanced Stochastic Oscillator
//@param high Series of high prices
+2 -2
View File
@@ -4,7 +4,7 @@
| ---------------- | -------------------------------- |
| **Category** | Oscillator |
| **Inputs** | Source (close) |
| **Parameters** | `r1` (default DefaultR1), `r2` (default DefaultR2), `r3` (default DefaultR3), `r4` (default DefaultR4), `s1` (default DefaultS1), `s2` (default DefaultS2), `s3` (default DefaultS3), `s4` (default DefaultS4), `sigPeriod` (default DefaultSigPeriod) |
| **Parameters** | `r1` (default 10), `r2` (default 15), `r3` (default 20), `r4` (default 30), `s1` (default 10), `s2` (default 10), `s3` (default 10), `s4` (default 15), `sigPeriod` (default 9) |
| **Outputs** | Multiple series (KstValue, Signal) |
| **Output range** | Varies (see docs) |
| **Warmup** | `Math.Max(Math.Max(r1, r2), Math.Max(r3, r4))
@@ -14,7 +14,7 @@
### TL;DR
- The Know Sure Thing is a multi-timeframe momentum oscillator that computes four Rate of Change values at progressively longer lookback periods, smo...
- Parameterized by `r1` (default defaultr1), `r2` (default defaultr2), `r3` (default defaultr3), `r4` (default defaultr4), `s1` (default defaults1), `s2` (default defaults2), `s3` (default defaults3), `s4` (default defaults4), `sigperiod` (default defaultsigperiod).
- Parameterized by `r1` (default 10), `r2` (default 15), `r3` (default 20), `r4` (default 30), `s1` (default 10), `s2` (default 10), `s3` (default 10), `s4` (default 15), `sigPeriod` (default 9).
- Output range: Varies (see docs).
- Requires `Math.Max(Math.Max(r1, r2), Math.Max(r3, r4))
+ Math.Max(Math.Max(s1, s2), Math.Max(s3, s4))
+3 -2
View File
@@ -1,11 +1,12 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
// LRSI: Laguerre RSI
// John Ehlers, "Cybernetic Analysis for Stocks and Futures" (2004)
// A modified RSI that uses a 4-element Laguerre filter as its core moving average.
// The gamma parameter controls the damping of the filter stages, trading
// responsiveness against smoothness. Output is dimensionless [0, 1].
indicator("LRSI: Laguerre RSI", shorttitle="LRSI", overlay=false)
indicator("Laguerre RSI (LRSI)", "LRSI", overlay=false)
gamma = input.float(0.5, "Gamma", minval=0.0, maxval=1.0, step=0.01,
tooltip="Damping factor [0,1]. Lower = more responsive; higher = smoother.")
+3 -1
View File
@@ -1,5 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("MARKETFI: Market Facilitation Index", shorttitle="MARKETFI", overlay=false)
indicator("Market Facilitation Index (MARKETFI)", "MARKETFI", overlay=false)
// Bill Williams' Market Facilitation Index (BW MFI)
// Measures price movement efficiency per unit of volume.
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Pretty Good Oscillator", "PGO", overlay=false)
indicator("Pretty Good Oscillator (PGO)", "PGO", overlay=false)
//@function Calculate Pretty Good Oscillator (PGO)
//@param source Price data to analyze
+2 -2
View File
@@ -4,7 +4,7 @@
| ---------------- | -------------------------------- |
| **Category** | Oscillator |
| **Inputs** | Source (close) |
| **Parameters** | `rsiPeriod` (default DefaultRsiPeriod), `smoothFactor` (default DefaultSmoothFactor), `qqeFactor` (default DefaultQqeFactor) |
| **Parameters** | `rsiPeriod` (default 14), `smoothFactor` (default 5), `qqeFactor` (default 4.236) |
| **Outputs** | Single series (Qqe) |
| **Output range** | Varies (see docs) |
| **Warmup** | `rsiPeriod + smoothFactor + darPeriod * 2` bars |
@@ -12,7 +12,7 @@
### TL;DR
- Quantitative Qualitative Estimation applies a multi-stage smoothing pipeline to RSI and then constructs dynamic volatility-based trailing bands aro...
- Parameterized by `rsiperiod` (default defaultrsiperiod), `smoothfactor` (default defaultsmoothfactor), `qqefactor` (default defaultqqefactor).
- Parameterized by `rsiPeriod` (default 14), `smoothFactor` (default 5), `qqeFactor` (default 4.236).
- Output range: Varies (see docs).
- Requires `rsiPeriod + smoothFactor + darPeriod * 2` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
+2 -4
View File
@@ -1,7 +1,5 @@
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
// https://mozilla.org/MPL/2.0/
// © QuanTAlib
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Ehlers Reflex Indicator (REFLEX)", "REFLEX", overlay = false)
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Stochastic Oscillator (STOCH)", "Stoch", overlay=false)
indicator("Stochastic Oscillator (STOCH)", "STOCH", overlay=false)
//@function Calculates the Stochastic Oscillator (%K and %D). %K = 100 * (close - lowest_low(kLength)) / (highest_high(kLength) - lowest_low(kLength)). %D = SMA(%K, dPeriod). Uses efficient deque implementation for min/max and buffer-based SMA.
//@param kLength `simple int` The lookback period for calculating highest high and lowest low.
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Stochastic RSI (STOCHRSI)", "StochRSI", overlay=false)
indicator("Stochastic RSI (STOCHRSI)", "STOCHRSI", overlay=false)
//@function Calculates Stochastic RSI oscillator
//@param source Source series to calculate STOCHRSI for
+1 -1
View File
@@ -2,7 +2,7 @@
// © mihakralj
//@version=6
// Indicator algorithm (C) 2013 John F. Ehlers
indicator(" Ehlers Trendflex Indicator (TRENDFLEX)", "TRENDFLEX", overlay=false)
indicator("Ehlers Trendflex (TRENDFLEX)", "TRENDFLEX", overlay=false)
//@function Calculates Ehlers Trendflex using SuperSmoother pre-filtering and cumulative slope with RMS normalization
//@param source Series to calculate Trendflex from
+1 -1
View File
@@ -1,7 +1,7 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("TRIX", "TRIX", overlay=false)
indicator("Triple Exponential Average (TRIX)", "TRIX", overlay=false)
//@function Calculates TRIX oscillator with compensation
//@param source Series to calculate TRIX from
+67
View File
@@ -0,0 +1,67 @@
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("TTM Wave (TTM_WAVE)", "TTM_WAVE", overlay=false)
//@function EMA — standard exponential moving average for MACD computation.
//@param src Source series
//@param length EMA period
//@returns EMA value
ema_calc(series float src, simple int length) =>
float alpha = 2.0 / (length + 1)
var float result = 0.0
result := bar_index == 0 ? src : alpha * src + (1 - alpha) * result
result
//@function MACD histogram — (fast_ema - slow_ema) - signal_ema(fast_ema - slow_ema)
// This is the second derivative of momentum: acceleration of the spread.
//@param src Source series
//@param fast Fast EMA period
//@param slow Slow EMA period
//@param signal Signal EMA period (same as slow for TTM Wave)
//@returns MACD histogram value
macd_hist(series float src, simple int fast, simple int slow, simple int signal) =>
float fast_ema = ema_calc(src, fast)
float slow_ema = ema_calc(src, slow)
float macd_line = fast_ema - slow_ema
float signal_line = ema_calc(macd_line, signal)
macd_line - signal_line
//@function TTM Wave — six parallel MACD histogram channels at Fibonacci periods.
// Wave A (short-term): channels 1 (8,34,34) and 2 (8,55,55)
// Wave B (medium-term): channels 3 (8,89,89) and 4 (8,144,144)
// Wave C (long-term): channels 5 (8,233,233) and 6 (8,377,377)
// All channels share fast period 8. Signal period equals slow period.
//@param src Source series (default: close)
//@returns [waveA1, waveA2, waveB1, waveB2, waveC1, waveC2]
//@reference John Carter, "Mastering the Trade" (2005, 2012)
//@optimized Six independent EMA cascades, O(1) per bar per channel
ttm_wave(series float src) =>
float waveA1 = macd_hist(src, 8, 34, 34)
float waveA2 = macd_hist(src, 8, 55, 55)
float waveB1 = macd_hist(src, 8, 89, 89)
float waveB2 = macd_hist(src, 8, 144, 144)
float waveC1 = macd_hist(src, 8, 233, 233)
float waveC2 = macd_hist(src, 8, 377, 377)
[waveA1, waveA2, waveB1, waveB2, waveC1, waveC2]
// ── Inputs ──
float i_src = input.source(close, "Source")
// ── Calculation ──
[waveA1, waveA2, waveB1, waveB2, waveC1, waveC2] = ttm_wave(i_src)
// ── Plot (thinkorswim color convention) ──
// Wave A: yellow/green (short-term momentum)
plot(waveA1, "Wave A1", color=color.yellow, style=plot.style_histogram, linewidth=2)
plot(waveA2, "Wave A2", color=color.lime, style=plot.style_histogram, linewidth=2)
// Wave B: magenta/pink (medium-term momentum)
plot(waveB1, "Wave B1", color=color.fuchsia, style=plot.style_histogram, linewidth=2)
plot(waveB2, "Wave B2", color=color.new(color.fuchsia, 40), style=plot.style_histogram, linewidth=2)
// Wave C: red/orange (long-term momentum)
plot(waveC1, "Wave C1", color=color.red, style=plot.style_histogram, linewidth=2)
plot(waveC2, "Wave C2", color=color.orange, style=plot.style_histogram, linewidth=2)
hline(0, "Zero", color=color.gray, linestyle=hline.style_dotted)