Merge branch 'dev'

This commit is contained in:
Miha Kralj
2026-03-13 13:47:10 -07:00
404 changed files with 2754 additions and 1763 deletions
+12 -2
View File
@@ -36,8 +36,9 @@ bld/
*.coverage
*.coveragexml
# NDepend (entire directory — tooling + generated output)
ndepend/
# NDepend generated output (analysis results + coverage data)
ndepend/NDependOut/
ndepend/coverage/
# BenchmarkDotNet
BenchmarkDotNet.Artifacts/
@@ -110,3 +111,12 @@ $null
# Local secrets
.secrets
# Temp utility scripts (not shipped)
NOT
_fix_bullets.ps1
_indicator_md_list.txt
affected_files.txt
fix-bullets.ps1
fix_bullets.py
fix_read.py
+2
View File
@@ -1,3 +1,5 @@
* [<span style="color: gold;">**All indicators**</span>](/lib/_index.md)
* [Core](/lib/core/_index.md)
* [AVGPRICE - Average Price](/lib/core/avgprice/Avgprice.md)
* [HA - Heikin-Ashi](/lib/core/ha/Ha.md)
+1 -1
View File
@@ -1 +1 @@
0.8.5
0.8.6
-24
View File
@@ -1,29 +1,5 @@
# QuanTAlib Indicators
## Categories
| Category | Count | Description |
| :----------------------------------- | :-----: | :----------------------------------------------- |
| [Core](core/_index.md) | 8 | Price transforms and fundamental building blocks |
| [Trends (FIR)](trends_FIR/_index.md) | 33 | Finite Impulse Response moving averages |
| [Trends (IIR)](trends_IIR/_index.md) | 36 | Infinite Impulse Response moving averages |
| [Filters](filters/_index.md) | 37 | Signal processing filters |
| [Oscillators](oscillators/_index.md) | 48 | Indicators that fluctuate around a center line |
| [Dynamics](dynamics/_index.md) | 21 | Trend strength and direction indicators |
| [Momentum](momentum/_index.md) | 19 | Momentum-based indicators |
| [Volatility](volatility/_index.md) | 26 | Volatility estimators and indicators |
| [Volume](volume/_index.md) | 27 | Volume-based indicators |
| [Statistics](statistics/_index.md) | 35 | Statistical measures and tests |
| [Channels](channels/_index.md) | 23 | Price channels and bands |
| [Cycles](cycles/_index.md) | 14 | Cycle analysis and signal processing |
| [Reversals](reversals/_index.md) | 12 | Pattern recognition and reversal detection |
| [Forecasts](forecasts/_index.md) | 1 | Predictive indicators |
| [Errors](errors/_index.md) | 26 | Error metrics and loss functions |
| [Numerics](numerics/_index.md) | 27 | Mathematical transformations |
| **Total** | **393** | |
## All Indicators
| Indicator | Full Name | Category |
| :--------------------------------------------------------- | :------------------------------------------------------------------------ | :----------- |
| [ABERR](channels/aberr/Aberr.md) | Aberration Bands | Channels |
+4 -4
View File
@@ -12,11 +12,11 @@
| **Warmup** | `period` bars |
| **PineScript** | [aberr.pine](aberr.pine) |
- ABERR measures price deviation from a central moving average using mean absolute deviation rather than standard deviation, producing dynamic bands ...
- Parameterized by `period`, `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- ABERR measures price deviation from a central moving average using mean absolute deviation rather than standard deviation, producing dynamic bands that are more robust to outliers than Bollinger Bands.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
- **Similar indicators:** [BBands](../bbands/bbands.md) (standard deviation bands), [SDChannel](../sdchannel/sdchannel.md) (standard deviation channel), [STBands](../stbands/stbands.md) (Stoller bands using ATR).
- **Complementary indicators:** Pair with a momentum oscillator such as RSI or Stochastic to confirm overbought/oversold signals when price touches the bands; volume indicators help distinguish genuine breakouts from false band penetrations.
- **Trading note:** Because MAD ≈ 0.80σ, ABERR bands are tighter than equivalently-scaled Bollinger Bands and produce fewer false signals during fat-tailed moves like earnings gaps or flash crashes.
ABERR measures price deviation from a central moving average using mean absolute deviation rather than standard deviation, producing dynamic bands that adapt to volatility while remaining robust against extreme outliers. Where Bollinger Bands amplify outliers through squaring (the $L^2$ norm), ABERR uses raw absolute differences (the $L^1$ norm), so bands respond to typical price behavior rather than the occasional spike that yanks everything sideways. For a 20-period window with a 2.0 multiplier, ABERR contains approximately 89% of normally-distributed price action, but its real advantage emerges with fat-tailed distributions where standard deviation overreacts to single-bar anomalies.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [accbands.pine](accbands.pine) |
- Acceleration Bands construct a volatility envelope using the intra-bar high-low range rather than close-to-close standard deviation, creating chann...
- Parameterized by `period`, `factor` (default 4.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [KChannel](../kchannel/kchannel.md) | **Complementary:** ADX for trend strength | **Trading note:** Wider than Bollinger Bands; effective for breakout trading using high-low range volatility.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Acceleration Bands construct a volatility envelope using the intra-bar high-low range rather than close-to-close standard deviation, creating channels that accommodate the full price excursion of the underlying asset. Each bar's contribution to band width is normalized by price level ($w = (H-L)/(H+L)$), making the bands scale-invariant across instruments. Three independent Simple Moving Averages of the adjusted high, adjusted low, and close prices form the upper, lower, and middle bands respectively. Headley's original breakout rule declares a trend when price closes outside the bands for two consecutive bars.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [apchannel.pine](apchannel.pine) |
- APCHANNEL applies exponential smoothing independently to price highs and lows, creating a dynamic envelope that "remembers" significant extremes wh...
- Parameterized by `alpha` (default 0.2).
- Output range: Tracks input.
- Requires `⌈3/alpha⌉` bars (default 15) of warmup before first valid output (IsHot = true).
- **Similar:** [RegChannel](../regchannel/regchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** Volume for breakout confirmation | **Trading note:** Based on pivot points; useful for identifying median price paths and potential support/resistance.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
APCHANNEL applies exponential smoothing independently to price highs and lows, creating a dynamic envelope that "remembers" significant extremes while gradually fading their influence over time. Unlike rigid Donchian channels that drop price extremes abruptly when they exit the lookback window (the "cliff effect"), APCHANNEL decays them smoothly through leaky integration. The result is a channel with continuously sloping boundaries that responds to volatility without the discontinuous jumps that plague fixed-window approaches. The algorithm is $O(1)$ per bar with only two state variables and no buffers.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [apz.pine](apz.pine) |
- APZ constructs a volatility-adaptive envelope using double-smoothed exponential moving averages with an aggressive smoothing factor derived from $\...
- Parameterized by `period`, `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [KChannel](../kchannel/kchannel.md) | **Complementary:** RSI for overbought/oversold confirmation | **Trading note:** EMA-based deviation adapts faster than standard deviation bands; responsive to recent volatility changes.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
APZ constructs a volatility-adaptive envelope using double-smoothed exponential moving averages with an aggressive smoothing factor derived from $\sqrt{\text{period}}$, making it significantly faster than standard EMA-based channels. The center line is a double-EMA of price; the band width is a double-EMA of the high-low range, scaled by a multiplier. Designed specifically for mean-reversion trading in non-trending markets, APZ identifies overbought/oversold extremes where price is likely to reverse rather than continue. A closing price outside the zone signals an immediate overshoot, not a breakout.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [atrbands.pine](atrbands.pine) |
- ATR Bands create a volatility-adaptive envelope by projecting Wilder's Average True Range above and below a central Simple Moving Average.
- Parameterized by `period`, `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [KChannel](../kchannel/kchannel.md), [STBands](../stbands/stbands.md) | **Complementary:** ADX to distinguish trend vs range | **Trading note:** Volatility-normalized symmetric bands using ATR; adapts to true volatility including gaps.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
ATR Bands create a volatility-adaptive envelope by projecting Wilder's Average True Range above and below a central Simple Moving Average. Unlike fixed-percentage envelopes or standard-deviation bands, ATR Bands use True Range to measure volatility, making them robust for assets with gaps, pre-market moves, and 24/7 trading where the "hidden" volatility between bars is significant. The True Range captures the maximum of intra-bar range, gap-up distance, and gap-down distance, ensuring that overnight gaps contribute fully to band width even when the current bar's open-to-close range is narrow.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [bbands.pine](bbands.pine) |
- Bollinger Bands construct a volatility-adaptive envelope around a Simple Moving Average using population standard deviation as the width measure.
- Parameterized by `period` (default defaultperiod), `multiplier` (default defaultmultiplier).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [KChannel](../kchannel/kchannel.md), [SDChannel](../sdchannel/sdchannel.md), [ABERR](../aberr/aberr.md) | **Complementary:** %B and BandWidth for squeeze detection; RSI for momentum confirmation | **Trading note:** Most widely used band indicator; 2s captures ~95% of normally-distributed data but markets exhibit fat tails.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Bollinger Bands construct a volatility-adaptive envelope around a Simple Moving Average using population standard deviation as the width measure. The bands expand during high-volatility periods and contract during consolidation, dynamically adapting to changing market conditions. Under Gaussian assumptions, $\pm 2\sigma$ contains approximately 95.4% of price action, but financial returns exhibit fat tails and volatility clustering, so the bands function more as a volatility-normalized reference frame than a strict probability envelope. The derived metrics %B (price position as a fraction of band width) and BandWidth (normalized band spread) extend the raw bands into a complete analytical toolkit.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [dchannel.pine](dchannel.pine) |
- Donchian Channels track the highest high and lowest low over a fixed lookback period, defining the absolute price boundaries within which an asset ...
- Parameterized by `period`.
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [PChannel](../pchannel/pchannel.md), [UChannel](../uchannel/uchannel.md) | **Complementary:** Volume on breakouts; ATR for position sizing | **Trading note:** Pure price-based highest high/lowest low; used in the original Turtle Trading system.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Donchian Channels track the highest high and lowest low over a fixed lookback period, defining the absolute price boundaries within which an asset has traded. Unlike volatility-based bands that compute statistical dispersion, Donchian Channels represent actual historical extremes — the literal "price box." The implementation uses monotonic deques for $O(1)$ amortized sliding-window max/min, ensuring that computing a 500-period channel costs no more than a 20-period one. The midpoint of the upper and lower bands serves as a simple trend bias indicator.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [decaychannel.pine](decaychannel.pine) |
- Decay Channel combines the absolute price boundaries of Donchian Channels with exponential decay toward the midpoint, creating an envelope that exp...
- Parameterized by `period`.
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DChannel](../dchannel/dchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** Trend indicators like ADX | **Trading note:** Bands decay toward price when no new extremes form, reducing lag compared to traditional channels.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Decay Channel combines the absolute price boundaries of Donchian Channels with exponential decay toward the midpoint, creating an envelope that expands instantly on new volatility but contracts smoothly during consolidation. While Donchian Channels hold their width until an extreme exits the lookback window, Decay Channel allows the bands to "forget" old extremes over time using a half-life model. The period parameter serves as the half-life: after that many bars without a new extreme, the band has decayed 50% of the distance back toward center. The decayed values are always clamped within Donchian bounds, ensuring they never extrapolate beyond actual price history.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [fcb.pine](fcb.pine) |
- Fractal Chaos Bands filter raw price action through Bill Williams' fractal detection logic, tracking the highest confirmed fractal high and lowest ...
- Parameterized by `period` (default 20).
- Output range: Tracks input.
- Requires `period + 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DChannel](../dchannel/dchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** Williams Fractals for additional confirmation | **Trading note:** Based on Bill Williams' fractal theory; bands update only on fractal pivots, creating a staircase pattern.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Fractal Chaos Bands filter raw price action through Bill Williams' fractal detection logic, tracking the highest confirmed fractal high and lowest confirmed fractal low over a lookback period. Unlike Donchian Channels which use every bar's high and low, FCB uses only structurally significant turning points — bars where the middle element of a 3-bar pattern is a local extremum. The result is a "cleaner" channel that ignores transient spikes and focuses on confirmed support and resistance levels. The bands tend to remain flat during trends and step discretely when new structural pivots form, making them useful for identifying genuine breakouts versus noise.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [Jbands.pine](Jbands.pine) |
- JBANDS expose the internal adaptive envelope mechanism of the Jurik Moving Average (JMA), producing asymmetric bands that snap instantly to new pri...
- Parameterized by `period`, `phase` (default 0).
- Output range: Tracks input.
- Requires `⌈20 + 80 × period^0.36⌉` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [KChannel](../kchannel/kchannel.md) | **Complementary:** Momentum oscillators for reversal timing | **Trading note:** Uses JMA (Jurik Moving Average) as center line for smoother, lower-lag bands compared to standard Bollinger.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
JBANDS expose the internal adaptive envelope mechanism of the Jurik Moving Average (JMA), producing asymmetric bands that snap instantly to new price extremes and decay exponentially during consolidation. Unlike standard volatility bands (Bollinger, Keltner) which maintain symmetric width around a center line, JBANDS feature "snap-and-decay" hysteresis: expansion is instantaneous (plasticity), contraction is gradual (elasticity). The decay rate is dynamically modulated by a two-stage volatility estimator — a 10-bar SMA feeding a 128-bar trimmed mean — making the bands tight during quiet markets and expansive during trends. The center line is the full JMA: a 2-pole IIR filter with phase control and adaptive alpha.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [kchannel.pine](kchannel.pine) |
- Keltner Channel constructs a volatility-adaptive envelope by projecting Average True Range above and below an Exponential Moving Average center line.
- Parameterized by `period` (default 20), `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period * 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [APZ](../apz/apz.md) | **Complementary:** Bollinger Band squeeze (BBands inside KChannel signals compression); MACD for trend direction | **Trading note:** ATR-based width adapts to true volatility including gaps; Chester Keltner's 1960 original used typical price and average range.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Keltner Channel constructs a volatility-adaptive envelope by projecting Average True Range above and below an Exponential Moving Average center line. The channel differs from ATR Bands solely in the center line: Keltner uses EMA (faster, more responsive) while ATR Bands use SMA (more stable, more lag). The EMA center combined with ATR width creates a channel that both tracks trend and adapts to volatility, making it one of the most widely used channel indicators for trend-following and mean-reversion strategies. The implementation uses EMA with warmup compensation for accurate early values and Wilder's smoothing (RMA) for ATR.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [maenv.pine](maenv.pine) |
- Moving Average Envelope (MA Envelope) constructs symmetric bands at a fixed percentage distance above and below a moving average center line.
- Parameterized by `period` (default 20), `percentage` (default 1.0), `matype` (default maenvtype.ema).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [APZ](../apz/apz.md) | **Complementary:** RSI at envelope extremes | **Trading note:** Fixed-percentage bands around a moving average; simplest channel indicator, useful as a baseline comparison.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Moving Average Envelope (MA Envelope) constructs symmetric bands at a fixed percentage distance above and below a moving average center line. Unlike volatility-adaptive channels (Bollinger, Keltner, ATR Bands) where band width varies with market conditions, MA Envelope uses a constant percentage offset, creating bands whose absolute width scales only with price level. The indicator supports configurable moving average types (SMA, EMA, WMA) for the center line, allowing users to trade off between lag, smoothness, and responsiveness.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mmchannel.pine](mmchannel.pine) |
- Min-Max Channel tracks the highest high and lowest low over a lookback period, creating a pure price envelope without any midpoint calculation.
- Parameterized by `period`.
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DChannel](../dchannel/dchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** ATR for volatility context | **Trading note:** Min/Max channel; breakout system based on highest high and lowest low.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Min-Max Channel tracks the highest high and lowest low over a lookback period, creating a pure price envelope without any midpoint calculation. Unlike Donchian Channels which include a middle band, MMCHANNEL delivers only the raw extremes. The implementation uses monotonic deques for O(1) amortized updates: each element enters the deque once and leaves at most once, so total work over $N$ bars is $O(N)$ regardless of period length.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [pchannel.pine](pchannel.pine) |
- Price Channel tracks the highest high and lowest low over a lookback period with a midpoint average, creating a three-line price envelope that defi...
- Parameterized by `period`.
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DChannel](../dchannel/dchannel.md), [MMChannel](../mmchannel/mmchannel.md) | **Complementary:** Volume confirmation on breakouts | **Trading note:** Price channel based on percentage offset from midpoint.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Price Channel tracks the highest high and lowest low over a lookback period with a midpoint average, creating a three-line price envelope that defines where the market has been. Functionally identical to Donchian Channels, the indicator uses actual price extremes rather than volatility estimates, producing bands that represent real support and resistance levels. This implementation uses monotonic deques for O(1) amortized updates instead of the naive O(n) rescan that most platforms use internally.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [regchannel.pine](regchannel.pine) |
- Linear Regression Channel plots a best-fit line through price data over a specified period with parallel bands at a configurable standard deviation...
- Parameterized by `period` (default 20), `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [SDChannel](../sdchannel/sdchannel.md), [BBands](../bbands/bbands.md) | **Complementary:** R-squared for trend strength | **Trading note:** Linear regression channel; mean-reversion trades at band extremes.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Linear Regression Channel plots a best-fit line through price data over a specified period with parallel bands at a configurable standard deviation of residuals. Unlike moving average envelopes that offset from a smoothed price, regression channels adapt their slope to the underlying trend and their width to actual dispersion around that trend. The algorithm uses ordinary least squares with precomputed index sums, requiring two passes per bar: one for the regression coefficients and one for the residual standard deviation.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [sdchannel.pine](sdchannel.pine) |
- Standard Deviation Channel plots a linear regression line through price data with parallel bands at a specified number of standard deviations of re...
- Parameterized by `period` (default 20), `multiplier` (default 2.0).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [RegChannel](../regchannel/regchannel.md) | **Complementary:** LinReg slope for trend direction | **Trading note:** Standard deviation channel around linear regression; tighter than Bollinger for trending markets.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Standard Deviation Channel plots a linear regression line through price data with parallel bands at a specified number of standard deviations of residuals above and below. Unlike Bollinger Bands which measure deviation from a moving average, SDCHANNEL measures deviation from the best-fit trend line, capturing how much price wanders from its underlying trajectory rather than from its simple average. The algorithm is identical to REGCHANNEL; the distinction is purely a naming convention found across different platforms and literature.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [starchannel.pine](starchannel.pine) |
- Stoller Average Range Channel creates a volatility-adaptive price envelope using Average True Range (ATR) to determine band width around a simple m...
- Parameterized by `period` (default 20), `multiplier` (default 2.0), `atrperiod` (default 0).
- Output range: Tracks input.
- Requires `Math.Max(period, effectiveAtrPeriod)` bars of warmup before first valid output (IsHot = true).
- **Similar:** [KChannel](../kchannel/kchannel.md), [ATRBands](../atrbands/atrbands.md) | **Complementary:** ADX for trend confirmation | **Trading note:** Stoller Average Range Channel; ATR-based bands around a moving average.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Stoller Average Range Channel creates a volatility-adaptive price envelope using Average True Range (ATR) to determine band width around a simple moving average centerline. The bands automatically expand during volatile periods and contract during calmer markets. The implementation uses a circular buffer for the SMA running sum and Wilder's RMA with a warmup compensator for ATR, achieving O(1) streaming updates per bar.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [stbands.pine](stbands.pine) |
- Super Trend Bands provide ATR-based dynamic support and resistance levels with asymmetric ratchet logic: the upper band only tightens downward duri...
- Parameterized by `period` (default defaultperiod), `multiplier` (default defaultmultiplier).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [KChannel](../kchannel/kchannel.md) | **Complementary:** Volume for breakout validation | **Trading note:** Stoller bands use ATR multiplier instead of standard deviation.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Super Trend Bands provide ATR-based dynamic support and resistance levels with asymmetric ratchet logic: the upper band only tightens downward during downtrends, and the lower band only tightens upward during uptrends. This creates natural trailing stop-loss levels that respect market momentum. A trend direction signal ($+1$ or $-1$) flips when price breaches the opposite band. The ATR is computed as a simple moving average of True Range via a ring buffer with running sum, providing O(1) streaming updates.
+1 -4
View File
@@ -12,9 +12,6 @@
| **Warmup** | `period` bars |
- TTM Linear Regression Channel plots a least-squares regression line through price data with dual standard deviation bands at $\pm 1\sigma$ and $\pm...
- Parameterized by `period` (default 100).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
TTM Linear Regression Channel plots a least-squares regression line through price data with dual standard deviation bands at $\pm 1\sigma$ and $\pm 2\sigma$. Developed by John Carter as part of his TTM (Trade The Markets) indicator suite, it extends the standard regression channel by providing two band levels that create statistically meaningful trading zones. The algorithm is identical to REGCHANNEL/SDCHANNEL in its regression and residual computation, but uses a longer default period (100) and emits four bands instead of two.
@@ -139,4 +136,4 @@ Both passes iterate over contiguous ring buffer memory, enabling SIMD vectorizat
- Carter, J. (2005). *Mastering the Trade*. McGraw-Hill.
- Raff, G. (1991). "Trading the Regression Channel." *Technical Analysis of Stocks & Commodities*.
- Draper, N. & Smith, H. (1998). *Applied Regression Analysis*. Wiley.
- Draper, N. & Smith, H. (1998). *Applied Regression Analysis*. Wiley.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ubands.pine](ubands.pine) |
- Ehlers Ultimate Bands replace the conventional SMA foundation of Bollinger Bands with the Ultrasmooth Filter (USF), a 2-pole IIR filter with zero o...
- Parameterized by `period` (default defaultperiod), `multiplier` (default defaultmultiplier).
- Output range: Tracks input.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [BBands](../bbands/bbands.md), [SDChannel](../sdchannel/sdchannel.md) | **Complementary:** RSI for overbought/oversold | **Trading note:** Uncertainty bands; statistical confidence intervals around a moving average.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Ehlers Ultimate Bands replace the conventional SMA foundation of Bollinger Bands with the Ultrasmooth Filter (USF), a 2-pole IIR filter with zero overshoot and minimal lag. Band width is determined by the RMS (Root Mean Square) of residuals between price and the smoothed centerline, providing a mathematically rigorous deviation measure that makes no assumptions about the distribution of returns. The USF is a recursive filter requiring O(1) computation per bar, while the RMS calculation scans the lookback window at O(n) per bar.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [uchannel.pine](uchannel.pine) |
- Ehlers Ultimate Channel applies the Ultrasmooth Filter (USF) twice: once to the close price for the centerline and once to True Range for band widt...
- Parameterized by `strperiod` (default defaultstrperiod), `centerperiod` (default defaultcenterperiod), `multiplier` (default defaultmultiplier).
- Output range: Tracks input.
- Requires `Math.Max(strPeriod, centerPeriod)` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DChannel](../dchannel/dchannel.md), [PChannel](../pchannel/pchannel.md) | **Complementary:** Volume for breakout confirmation | **Trading note:** Upper/lower channel based on recent price extremes.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Ehlers Ultimate Channel applies the Ultrasmooth Filter (USF) twice: once to the close price for the centerline and once to True Range for band width, creating a channel where both the trend estimate and the volatility measure share the same low-lag, zero-overshoot filter characteristics. Unlike UBANDS which uses RMS of price residuals, UCHANNEL uses Smoothed True Range (STR) for band width, making it responsive to gap-inclusive volatility. Separate period parameters allow independent tuning of centerline smoothness and band-width responsiveness.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [vwapbands.pine](vwapbands.pine) |
- VWAP Bands extend the Volume Weighted Average Price with dual standard deviation bands at $\pm 1\sigma$ and $\pm 2\sigma$ levels, creating a five-l...
- Parameterized by `multiplier` (default defaultmultiplier).
- Output range: Tracks input.
- Requires `2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [VwapSD](../vwapsd/vwapsd.md), [BBands](../bbands/bbands.md) | **Complementary:** Volume profile | **Trading note:** VWAP with deviation bands; institutional benchmark for intraday fair value.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
VWAP Bands extend the Volume Weighted Average Price with dual standard deviation bands at $\pm 1\sigma$ and $\pm 2\sigma$ levels, creating a five-line channel system anchored to volume-weighted fair value. Three running sums (cumulative price×volume, cumulative volume, cumulative price²×volume) enable O(1) streaming updates per bar. A session reset mechanism clears accumulations at configurable intervals, keeping the indicator anchored to current market structure.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [vwapsd.pine](vwapsd.pine) |
- VWAP with Standard Deviation Bands combines the Volume Weighted Average Price with a single configurable standard deviation band pair, providing a ...
- Parameterized by `numdevs` (default defaultnumdevs).
- Output range: Tracks input.
- Requires `2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [VwapBands](../vwapbands/vwapbands.md), [BBands](../bbands/bbands.md) | **Complementary:** Cumulative volume delta | **Trading note:** VWAP standard deviation bands; 1σ/2σ/3σ levels used for institutional mean-reversion.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
VWAP with Standard Deviation Bands combines the Volume Weighted Average Price with a single configurable standard deviation band pair, providing a simpler alternative to VWAPBANDS (which uses dual $\pm 1\sigma$ and $\pm 2\sigma$ levels). Three running sums enable O(1) streaming updates. A session reset mechanism clears accumulations at configurable intervals, keeping the indicator anchored to current market structure. The configurable deviation parameter allows traders to select their desired confidence level ($1\sigma$ ≈ 68%, $2\sigma$ ≈ 95%, $3\sigma$ ≈ 99.7%).
+1 -3
View File
@@ -14,8 +14,6 @@
- AVGPRICE computes the arithmetic mean of a bar's four canonical prices: Open, High, Low, and Close.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
AVGPRICE computes the arithmetic mean of a bar's four canonical prices: Open, High, Low, and Close. The formula $\frac{O + H + L + C}{4}$ produces a single representative price that weights all four price components equally, unlike Typical Price (which excludes Open) or Weighted Close (which double-weights Close). This equal weighting makes AVGPRICE the least biased single-bar summary statistic, useful as a neutral input to downstream indicators when no particular price component deserves emphasis. The calculation is stateless, requires no warmup, and costs a single FMA instruction per bar.
@@ -96,4 +94,4 @@ $O(1)$ per bar. Two additions, one FMA. No memory allocation. Always hot after t
## Resources
- **TA-Lib** `TA_AVGPRICE` function reference.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
+1 -3
View File
@@ -14,8 +14,6 @@
- HA transforms standard OHLC bars into smoothed Heikin-Ashi candles by averaging each component with its predecessor.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HA transforms standard OHLC bars into smoothed Heikin-Ashi candles by averaging each component with its predecessor. The Close is the bar's four-price mean $(O+H+L+C)/4$, the Open is a recursive midpoint of the prior HA Open and HA Close, and High/Low are clamped extremes that guarantee the HA body always fits inside the HA wick. Unlike most indicators that reduce a bar to a single scalar, HA outputs a complete `TBar` — four smoothed prices per bar — making it a bar-to-bar transform rather than a bar-to-value reduction. The recursive Open gives HA an IIR character: each bar carries a decaying memory of the entire price history, which is what flattens trend noise but also why HA prices do not match any actual traded price.
@@ -202,4 +200,4 @@ Validated against external libraries in `Ha.Validation.Tests.cs`. HA is widely i
- **Valcu, D.** (2004). "Using The Heikin-Ashi Technique." *Technical Analysis of Stocks & Commodities*, Vol. 22, No. 2.
- **Nison, S.** (1991). *Japanese Candlestick Charting Techniques*. New York Institute of Finance.
- **Vervoort, S.** (2008). "Smoothing Heikin-Ashi." *Technical Analysis of Stocks & Commodities*.
- [Investopedia: Heikin-Ashi](https://www.investopedia.com/terms/h/heikinashi.asp) — accessible introduction to the technique and its trading applications.
- [Investopedia: Heikin-Ashi](https://www.investopedia.com/terms/h/heikinashi.asp) — accessible introduction to the technique and its trading applications.
+1 -3
View File
@@ -14,8 +14,6 @@
- MEDPRICE computes the midpoint of a bar's High and Low: $(H + L) \times 0.5$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
MEDPRICE computes the midpoint of a bar's High and Low: $(H + L) \times 0.5$. This is the simplest possible estimate of a bar's "fair value," splitting the difference between the session's extremes while ignoring both the opening gap and closing settlement. The result represents the geometric center of the bar's vertical range. Because it excludes Open and Close, MEDPRICE responds purely to the supply/demand boundaries that the market tested, making it a useful input for range-based indicators like CCI or as a detrending reference. Stateless, zero-warmup, one addition and one multiply per bar.
@@ -95,4 +93,4 @@ $O(1)$ per bar. One addition, one multiply. No memory allocation. Always hot aft
## Resources
- **TA-Lib** `TA_MEDPRICE` function reference.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
- **Murphy, J.J.** *Technical Analysis of the Financial Markets*. New York Institute of Finance, 1999.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [midpoint.pine](midpoint.pine) |
- Single-series rolling midpoint: `(Highest(V, N) + Lowest(V, N)) * 0.5`.
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MidPrice](../midprice/Midprice.md), [Midbody](../midbody/Midbody.md) | **Trading note:** (Highest+Lowest)/2 over period; simple support/resistance level.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Single-series rolling midpoint: `(Highest(V, N) + Lowest(V, N)) * 0.5`. Returns the center of the value range within a lookback window. TA-Lib compatible (`MIDPOINT` function). Unlike MIDPRICE which operates on separate High/Low bar channels, MIDPOINT operates on a single value series.
@@ -108,4 +106,4 @@ The span-based `Batch` method uses a single `RingBuffer` with linear scan for ma
## References
- TA-Lib `MIDPOINT` function documentation
- Murphy, J. *Technical Analysis of the Financial Markets* (range-based indicators)
- Murphy, J. *Technical Analysis of the Financial Markets* (range-based indicators)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [midprice.pine](midprice.pine) |
- MIDPRICE computes the center of a rolling price channel by averaging the highest High and lowest Low over the past $N$ bars: $(\text{Highest}(H, N)...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MidPoint](../midpoint/Midpoint.md), [TypPrice](../typprice/typprice.md) | **Trading note:** (High+Low)/2; common price proxy for indicators avoiding close bias.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
MIDPRICE computes the center of a rolling price channel by averaging the highest High and lowest Low over the past $N$ bars: $(\text{Highest}(H, N) + \text{Lowest}(L, N)) \times 0.5$. Unlike the stateless price transforms (AVGPRICE, MEDPRICE, TYPPRICE, WCLPRICE) that operate on a single bar, MIDPRICE maintains a lookback window and produces a rolling estimate of the price range's midpoint. This makes it a simplified channel center line, equivalent to the midpoint of a Donchian Channel. The calculation uses two internal RingBuffers for $O(N)$ max/min computation per bar. TA-Lib compatible via `TA_MIDPRICE`.
@@ -116,4 +114,4 @@ A monotonic deque (sliding window max/min) would reduce per-bar cost from $O(N)$
- **TA-Lib** `TA_MIDPRICE` function reference.
- **Donchian, R.** "High Finance in Copper." *Financial Analysts Journal*, 1960. (Origin of channel-based price analysis)
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000.
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000.
+1 -3
View File
@@ -11,8 +11,6 @@
- `SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan<double>`.
- No configurable parameters; computation is stateless per bar.
- 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.
`SimdExtensions` provides high-performance, SIMD-accelerated extension methods for `ReadOnlySpan<double>`. It leverages .NET's `Vector<T>` to achieve 4-8x speedups on supported hardware (AVX2, AVX-512) while automatically falling back to scalar implementations on older hardware.
@@ -64,4 +62,4 @@ bool hasInvalid = span.ContainsNonFinite();
// Calculate dot product
double dot = span.DotProduct(otherSpan);
```
```
+1 -3
View File
@@ -11,8 +11,6 @@
- `TBar` is a lightweight, immutable struct representing a single OHLCV (Open, High, Low, Close, Volume) bar.
- No configurable parameters; computation is stateless per bar.
- 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.
## What It Does
@@ -137,4 +135,4 @@ TBar is a 48-byte struct (DateTime + 5 doubles). Field access and construction a
## References
* [OHLC Chart](https://en.wikipedia.org/wiki/Open-high-low-close_chart)
* [C# Record Structs](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record)
* [C# Record Structs](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TBarSeries` is a high-performance collection of OHLCV bars.
- No configurable parameters; computation is stateless per bar.
- 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.
## What It Does
@@ -146,4 +144,4 @@ SoA layout enables SIMD processing: each field array is contiguous in memory. Co
## References
* [Structure of Arrays (SoA)](https://en.wikipedia.org/wiki/AOS_and_SOA)
* [Data Locality](https://gameprogrammingpatterns.com/data-locality.html)
* [Data Locality](https://gameprogrammingpatterns.com/data-locality.html)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TSeries` is a high-performance, memory-efficient container for time-series data.
- No configurable parameters; computation is stateless per bar.
- 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.
## What It Does
@@ -140,4 +138,4 @@ The Pub/Sub dispatch dominates practical throughput when multiple subscribers ar
## References
* [Data-Oriented Design](https://en.wikipedia.org/wiki/Data-oriented_design)
* [SIMD in .NET](https://learn.microsoft.com/en-us/dotnet/standard/simd)
* [SIMD in .NET](https://learn.microsoft.com/en-us/dotnet/standard/simd)
+1 -3
View File
@@ -11,8 +11,6 @@
- `TValue` is the fundamental atomic unit of data in QuanTAlib.
- No configurable parameters; computation is stateless per bar.
- 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.
## What It Does
@@ -131,4 +129,4 @@ TValue is a 16-byte struct (DateTime + double). Construction and field access ar
## References
* [Structure of Arrays (SoA)](https://en.wikipedia.org/wiki/AOS_and_SOA)
* [C# Struct Performance](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct)
* [C# Struct Performance](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/struct)
+1 -3
View File
@@ -14,8 +14,6 @@
- TYPPRICE computes the equal-weighted average of Open, High, and Low: $(O + H + L) \times \frac{1}{3}$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Equivalent to `TBar.OHL3` computed property.
TYPPRICE computes the equal-weighted average of Open, High, and Low: $(O + H + L) \times \frac{1}{3}$. This three-component mean captures the opening price and the full intra-bar range without including the settlement (Close). By excluding Close, Typical Price isolates the session's initial positioning and range extremes, making it useful as an input where you want a price representative that is independent of closing action. The calculation is stateless and costs a single FMA instruction per bar.
@@ -92,4 +90,4 @@ Division by a non-power-of-two constant is 4-5x more expensive than multiplicati
## Resources
- **QuanTAlib** `TBar.OHL3` computed property reference.
- **QuanTAlib** `TBar.OHL3` computed property reference.
+1 -3
View File
@@ -14,8 +14,6 @@
- WCLPRICE computes a Close-biased average of High, Low, and Close by double-weighting the closing price: $(H + L + 2C) \times 0.25$.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `1` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
WCLPRICE computes a Close-biased average of High, Low, and Close by double-weighting the closing price: $(H + L + 2C) \times 0.25$. This gives Close 50% of the total weight versus 25% each for High and Low, reflecting the widely held belief that the closing price is the most important price of the bar because it represents the final consensus of buyers and sellers. The calculation is stateless, costs a single FMA instruction per bar, and is TA-Lib compatible (`TA_WCLPRICE`).
@@ -100,4 +98,4 @@ $O(1)$ per bar. One addition, one FMA. No memory allocation. Always hot after th
## Resources
- **TA-Lib** `TA_WCLPRICE` function reference.
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000. (Weighted Close definition)
- **Achelis, S.B.** *Technical Analysis from A to Z*. McGraw-Hill, 2000. (Weighted Close definition)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ccor.pine](ccor.pine) |
- CCOR extracts cycle phase by computing Pearson correlation of a price window against cosine (Real) and negative-sine (Imaginary) reference waves of...
- Parameterized by `period` (default 20), `threshold` (default 9.0).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Ccyc](../ccyc/Ccyc.md), [CG](../cg/cg.md) | **Complementary:** Hilbert Transform for phase analysis | **Trading note:** Cycle correlation; detects dominant cycle period in price data.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
CCOR extracts cycle phase by computing Pearson correlation of a price window against cosine (Real) and negative-sine (Imaginary) reference waves of a presumed fixed period, converting the resulting phasor to an angle with a monotonic constraint, and classifying the market state as trending or cycling based on the angle rate of change. Unlike Hilbert Transform approaches that rely on analytic signal construction, CCOR uses the statistical machinery of correlation to measure how well price "fits" each quadrature component, yielding bounded $[-1, +1]$ outputs that double as confidence measures. The method was introduced to address the instability of Hilbert-based phasors during trend-dominated regimes.
@@ -136,4 +134,4 @@ For default period $N = 20$: ~269 cycles per bar. The O(N) cost comes from dual
- **Ehlers, J.F.** "Correlation As A Cycle Indicator." *Technical Analysis of Stocks & Commodities*, June 2020.
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001. (Hilbert Transform phasor predecessor)
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004. (Broader cycle analysis framework)
- **Pearson, K.** "Notes on Regression and Inheritance in the Case of Two Parents." *Proceedings of the Royal Society of London*, 58, 1895. (Original Pearson correlation)
- **Pearson, K.** "Notes on Regression and Inheritance in the Case of Two Parents." *Proceedings of the Royal Society of London*, 58, 1895. (Original Pearson correlation)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ccyc.pine](ccyc.pine) |
- CCYC isolates the dominant cycle component from price data using a 2-pole high-pass IIR filter applied to a 4-tap FIR-smoothed input, producing an ...
- Parameterized by `alpha` (default 0.07).
- Output range: Varies (see docs).
- Requires `7` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Ccor](../ccor/Ccor.md), [CG](../cg/cg.md) | **Complementary:** EBSW for trend/cycle mode | **Trading note:** Cyber Cycle; Ehlers' bandpass approach to isolate dominant market cycles.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
CCYC isolates the dominant cycle component from price data using a 2-pole high-pass IIR filter applied to a 4-tap FIR-smoothed input, producing an oscillator that strips trend while preserving cyclical content with minimal lag. The companion trigger line (one-bar delay of the cycle output) provides crossover signals for timing entries and exits. Unlike band-pass approaches that require specifying a center frequency, CCYC's high-pass architecture extracts whatever cyclic energy exists above a cutoff controlled by a single $\alpha$ damping parameter, making it adaptive to the dominant period present in the data.
@@ -152,4 +150,4 @@ O(1) per bar. The 4-tap FIR smoother uses 3 MUL + 2 ADD; the 2-pole IIR high-pas
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001. (Foundational DSP framework for markets)
- **Ehlers, J.F.** "Cybernetic Analysis." *Technical Analysis of Stocks & Commodities*, 2004.
- **Wiener, N.** *Cybernetics: Or Control and Communication in the Animal and the Machine*. MIT Press, 1948. (Origin of the "cybernetic" terminology)
- **Oppenheim, A.V. & Schafer, R.W.** *Discrete-Time Signal Processing*. Pearson, 2009. (IIR filter theory, z-domain analysis)
- **Oppenheim, A.V. & Schafer, R.W.** *Discrete-Time Signal Processing*. Pearson, 2009. (IIR filter theory, z-domain analysis)
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [cg.pine](cg.pine) |
- CG identifies potential turning points using the physics concept of weighted center of mass applied to a price window.
- Parameterized by `period` (default 10).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Ccyc](../ccyc/Ccyc.md), [EACP](../eacp/eacp.md) | **Complementary:** RSI for momentum confirmation | **Trading note:** Center of Gravity oscillator by Ehlers; leads price turns with minimal lag.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
CG identifies potential turning points using the physics concept of weighted center of mass applied to a price window. Developed by John Ehlers, the oscillator measures where the "weight" of prices is concentrated within a lookback period, producing a leading indicator that oscillates around zero with minimal lag compared to traditional moving average crossover systems.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [dsp.pine](dsp.pine) |
- DSP creates a zero-centered oscillator by subtracting a half-cycle EMA from a quarter-cycle EMA, isolating the dominant cyclical component of price...
- Parameterized by `period` (default 40).
- Output range: Varies (see docs).
- Requires `slowPeriod * 3` bars of warmup before first valid output (IsHot = true).
- **Similar:** [SSFDSP](../ssfdsp/Ssfdsp.md), [Ccyc](../ccyc/Ccyc.md) | **Complementary:** ATR for volatility filter | **Trading note:** Digital Signal Processing filter; separates signal from noise in price data.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
DSP creates a zero-centered oscillator by subtracting a half-cycle EMA from a quarter-cycle EMA, isolating the dominant cyclical component of price while cancelling longer-term trends. Developed by John Ehlers, the indicator is grounded in cycle theory rather than arbitrary period selection, making it a principled alternative to MACD for cycle-aware trading. Bias-corrected EMAs ensure accurate amplitude during warmup.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [eacp.pine](eacp.pine) |
- EACP estimates the dominant cycle period of a financial time series by computing autocorrelation across multiple lags and transforming the result i...
- Parameterized by `minperiod` (default 8), `maxperiod` (default 48), `avglength` (default 3), `enhance` (default true).
- Output range: Varies (see docs).
- Requires `maxPeriod * 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [CG](../cg/cg.md), [HT_DCPeriod](../ht_dcperiod/ht_dcperiod.md) | **Complementary:** EBSW for trend/cycle classification | **Trading note:** Ehlers Autocorrelation Periodogram; identifies dominant cycle length adaptively.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
EACP estimates the dominant cycle period of a financial time series by computing autocorrelation across multiple lags and transforming the result into a power spectrum via the Wiener-Khinchin theorem. The output is a continuously updating cycle period measurement (in bars) that can adaptively tune other indicators to the market's current rhythm, making fixed-period assumptions unnecessary.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ebsw.pine](ebsw.pine) |
- EBSW is a refined cycle oscillator that combines a high-pass filter (trend removal), a Super-Smoother filter (noise removal), and Automatic Gain Co...
- Parameterized by `hplength` (default 40), `ssflength` (default 10).
- Output range: Varies (see docs).
- Requires `Math.Max(hpLength, ssfLength) + 3` bars (default 43) of warmup before first valid output (IsHot = true).
- **Similar:** [HT_TrendMode](../../dynamics/ht_trendmode/ht_trendmode.md), [VHF](../../dynamics/vhf/Vhf.md) | **Complementary:** ADX for trend strength | **Trading note:** Even Better Sine Wave; classifies market as trending or cycling.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
EBSW is a refined cycle oscillator that combines a high-pass filter (trend removal), a Super-Smoother filter (noise removal), and Automatic Gain Control to produce a normalized $[-1, +1]$ output representing the current position within the dominant market cycle. Developed by John Ehlers as an improvement over the original Hilbert Transform SineWave, it provides cleaner turning point detection without requiring complex phase extraction mathematics.
+1 -3
View File
@@ -13,9 +13,7 @@
| **PineScript** | [homod.pine](homod.pine) |
- HOMOD estimates the dominant cycle period of a market using homodyne mixing, a technique from radio engineering where a signal is multiplied by a d...
- Parameterized by `minperiod` (default 6.0), `maxperiod` (default 50.0).
- Output range: Varies (see docs).
- Requires `maxPeriod * 2` bars (default 100) of warmup before first valid output (IsHot = true).
- **Similar:** [HT_Phasor](../ht_phasor/ht_phasor.md), [HT_Sine](../ht_sine/ht_sine.md) | **Complementary:** Cycle period for context | **Trading note:** Homodyne discriminator; Ehlers' phase detection for cycle turning points.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HOMOD estimates the dominant cycle period of a market using homodyne mixing, a technique from radio engineering where a signal is multiplied by a delayed copy of itself to expose the angular phase change between samples. The output is a continuously varying period measurement (in bars) that tracks the market's instantaneous cycle length, enabling adaptive indicator tuning. Developed by John Ehlers, it offers better noise rejection and stability than the raw Hilbert Transform period estimator.
+1 -3
View File
@@ -14,8 +14,6 @@
- HT_DCPERIOD estimates the period of the dominant market cycle using Ehlers' Hilbert Transform cascade.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `LOOKBACK` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HT_DCPERIOD estimates the period of the dominant market cycle using Ehlers' Hilbert Transform cascade. The algorithm extracts In-Phase and Quadrature components from price, computes instantaneous phase via homodyne discrimination, and derives the period from the phase rate of change. Output is a continuously varying period (typically 6-50 bars) compatible with TA-Lib's `HT_DCPERIOD` function. The indicator enables dynamic tuning of other indicators to the market's actual rhythm rather than fixed-parameter assumptions.
@@ -112,4 +110,4 @@ The period range [6, 50] and all smoothing constants are fixed by the TA-Lib spe
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001.
- **TA-Lib** `TA_HT_DCPERIOD()` reference implementation.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
+1 -3
View File
@@ -14,8 +14,6 @@
- HT_DCPHASE measures the instantaneous phase angle of the dominant market cycle using Ehlers' Hilbert Transform cascade.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `LOOKBACK` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HT_DCPHASE measures the instantaneous phase angle of the dominant market cycle using Ehlers' Hilbert Transform cascade. The output ranges from $-45°$ to $315°$, with phase discontinuities at cycle completions marking the transition from one cycle to the next. Compatible with TA-Lib's `HT_DCPHASE` function, the indicator enables cycle-position timing for entries and exits based on where price currently sits within the dominant cycle.
@@ -114,4 +112,4 @@ All internal constants are fixed by the TA-Lib specification.
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001.
- **TA-Lib** `TA_HT_DCPHASE()` reference implementation.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
- **Hilbert, D.** *Grundzüge einer allgemeinen Theorie der linearen Integralgleichungen*. Teubner, 1912.
- **Hilbert, D.** *Grundzüge einer allgemeinen Theorie der linearen Integralgleichungen*. Teubner, 1912.
+1 -3
View File
@@ -14,8 +14,6 @@
- HT_PHASOR decomposes the price signal into two orthogonal components, InPhase ($I$) and Quadrature ($Q$), using the Hilbert Transform.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `LOOKBACK` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HT_PHASOR decomposes the price signal into two orthogonal components, InPhase ($I$) and Quadrature ($Q$), using the Hilbert Transform. Together these form a complex phasor $Z = I + jQ$ that describes the instantaneous amplitude and phase of the dominant market cycle. Compatible with TA-Lib's `HT_PHASOR` function, this dual-output indicator provides the fundamental building blocks for cycle analysis, phasor crossover timing, and instantaneous amplitude measurement.
@@ -105,4 +103,4 @@ $O(1)$ per bar. Fixed Hilbert cascade with circular buffers. Warmup: 32 bars (TA
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001.
- **TA-Lib** `TA_HT_PHASOR()` reference implementation.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
+1 -3
View File
@@ -14,8 +14,6 @@
- HT_SINE extracts the dominant market cycle phase and outputs both Sine and LeadSine (45° phase advance) for cycle timing.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `LOOKBACK` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
HT_SINE extracts the dominant market cycle phase and outputs both Sine and LeadSine (45° phase advance) for cycle timing. The crossover of these two waves identifies turning points in ranging markets up to one-eighth of a cycle early. Compatible with TA-Lib's `HT_SINE` function, the indicator builds on the full Hilbert Transform cascade (phasor extraction, homodyne period estimation, DFT phase accumulation) to produce dual bounded $[-1, +1]$ oscillators that track cycle position rather than price amplitude.
@@ -119,4 +117,4 @@ All constants are fixed by the TA-Lib specification.
- **Ehlers, J.F.** *Rocket Science for Traders*. Wiley, 2001.
- **TA-Lib** `TA_HT_SINE()` reference implementation.
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
- **Hilbert, D.** *Grundzüge einer allgemeinen Theorie der linearen Integralgleichungen*. Teubner, 1912.
- **Hilbert, D.** *Grundzüge einer allgemeinen Theorie der linearen Integralgleichungen*. Teubner, 1912.
+1 -3
View File
@@ -14,8 +14,6 @@
- LUNAR calculates the Moon's illumination fraction using precise orbital mechanics from Jean Meeus' *Astronomical Algorithms*.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `0` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
LUNAR calculates the Moon's illumination fraction using precise orbital mechanics from Jean Meeus' *Astronomical Algorithms*. Output ranges from 0.0 (New Moon) through 0.5 (Quarter) to 1.0 (Full Moon), providing a continuous astronomical cycle for research into potential lunar-correlated market behavior. The indicator is purely time-based, requires no price data, and has zero warmup since the calculation is deterministic from any timestamp.
@@ -126,4 +124,4 @@ The calculation is entirely determined by the input timestamp.
- **Meeus, J.** *Astronomical Algorithms*. 2nd ed., Willmann-Bell, 1998.
- **Dichev, I.D. & Janes, T.D.** "Lunar Cycle Effects in Stock Returns." *Journal of Private Equity*, 2001.
- **Yuan, K., Zheng, L. & Zhu, Q.** "Are Investors Moonstruck? Lunar Phases and Stock Returns." *Journal of Empirical Finance*, 2006.
- **Yuan, K., Zheng, L. & Zhu, Q.** "Are Investors Moonstruck? Lunar Phases and Stock Returns." *Journal of Empirical Finance*, 2006.
+1 -3
View File
@@ -14,8 +14,6 @@
- SOLAR models Earth's seasonal position relative to the Sun using astronomical ephemeris calculations.
- No configurable parameters; computation is stateless per bar.
- Output range: Varies (see docs).
- Requires `0` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
SOLAR models Earth's seasonal position relative to the Sun using astronomical ephemeris calculations. Output oscillates continuously from $-1.0$ (Winter Solstice) through $0.0$ (Equinoxes) to $+1.0$ (Summer Solstice), providing a smooth, mathematically precise seasonal phase for econometric modeling. Like LUNAR, the indicator is purely time-based, requires no price data, and has zero warmup since the calculation is deterministic from any timestamp.
@@ -123,4 +121,4 @@ The calculation is entirely determined by the input timestamp.
## Resources
- **Meeus, J.** *Astronomical Algorithms*. 2nd ed., Willmann-Bell, 1998.
- **USNO** *Astronomical Almanac*. U.S. Government Publishing Office (annual reference for solstice/equinox verification).
- **USNO** *Astronomical Almanac*. U.S. Government Publishing Office (annual reference for solstice/equinox verification).
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ssfdsp.pine](ssfdsp.pine) |
- SSFDSP isolates the dominant cycle by subtracting a half-cycle Super-Smoother from a quarter-cycle Super-Smoother, producing a zero-centered oscill...
- Parameterized by `period` (default 40).
- Output range: Varies (see docs).
- Requires `slowPeriod * 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [DSP](../dsp/dsp.md), [SSF2](../../filters/ssf2/Ssf2.md) | **Complementary:** Roofing filter for preprocessing | **Trading note:** Super Smoother with DSP; combines Ehlers' smoothing with signal processing.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
SSFDSP isolates the dominant cycle by subtracting a half-cycle Super-Smoother from a quarter-cycle Super-Smoother, producing a zero-centered oscillator with superior noise rejection compared to the EMA-based DSP. The 2-pole Butterworth characteristic of the Super-Smoother filter provides zero phase lag at the cutoff frequency and sharper rolloff than exponential smoothing, making SSFDSP the preferred variant for cycle-aware trading when the approximate dominant period is known.
@@ -119,4 +117,4 @@ The SSF has $-3$ dB attenuation at the cutoff period, $-12$ dB/octave rolloff (2
- **Ehlers, J.F.** *Cybernetic Analysis for Stocks and Futures*. Wiley, 2004.
- **Ehlers, J.F.** *Cycle Analytics for Traders*. Wiley, 2013.
- **Butterworth, S.** "On the Theory of Filter Amplifiers." *Experimental Wireless*, 7, 1930.
- **Butterworth, S.** "On the Theory of Filter Amplifiers." *Experimental Wireless*, 7, 1930.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [adx.pine](adx.pine) |
- The Average Directional Index is the industry-standard measure of trend strength, ignoring direction entirely to focus on the velocity of price exp...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period * 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADXR](../adxr/Adxr.md), [DX](../dx/Dx.md) | **Complementary:** Moving averages for direction | **Trading note:** Wilder's trend strength gauge; >25 trending, <20 ranging. Does not indicate direction.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Average Directional Index is the industry-standard measure of trend strength, ignoring direction entirely to focus on the velocity of price expansion. Wilder's pipeline decomposes range into directional movement (+DM, -DM), normalizes against True Range to produce directional indicators (+DI, -DI), derives a directional index (DX) from their ratio, then smooths DX with a final RMA pass. The double-smoothed architecture creates significant lag but exceptional noise rejection, making ADX a regime filter rather than a timing tool. Output is unbounded above 0, with readings above 25 conventionally indicating trending conditions and below 20 indicating choppy markets.
@@ -143,4 +141,4 @@ The recursive RMA passes block SIMD across bars. The TR/DM initial computation (
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `adx.pine` in indicator directory
- PineScript reference: `adx.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [adxr.pine](adxr.pine) |
- The Average Directional Movement Rating is a smoothed version of ADX that dampens short-term fluctuations in trend strength by averaging the curren...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `adx.WarmupPeriod + period - 1` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [DX](../dx/Dx.md) | **Complementary:** Aroon for trend timing | **Trading note:** Smoothed ADX; slower but fewer false signals. Used in Wilder's Directional Movement System.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Average Directional Movement Rating is a smoothed version of ADX that dampens short-term fluctuations in trend strength by averaging the current ADX with a historical ADX value. This creates a doubly-lagged metric that sacrifices all timing utility in exchange for stable regime classification. ADXR answers one question: does the current market environment reward trend-following strategies? If ADXR is high, deploy momentum logic. If low, deploy mean-reversion. It is a strategic filter, not a tactical signal.
@@ -116,4 +114,4 @@ The final averaging step is trivially vectorizable once the ADX time series is m
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `adxr.pine` in indicator directory
- PineScript reference: `adxr.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [alligator.pine](alligator.pine) |
- The Williams Alligator is a trend-following system that uses three Smoothed Moving Averages (SMMA/RMA) with different periods and forward display o...
- Parameterized by `jawperiod`, `jawoffset`, `teethperiod`, `teethoffset`, `lipsperiod`, `lipsoffset`.
- Output range: Varies (see docs).
- Requires `Math.Max(Math.Max(jawPeriod, teethPeriod), lipsPeriod)` bars of warmup before first valid output (IsHot = true).
- **Similar:** [AMAT](../amat/Amat.md), [Ichimoku](../ichimoku/Ichimoku.md) | **Complementary:** Fractal indicator for entry signals | **Trading note:** Bill Williams' Alligator; three displaced SMAs (Jaw/Teeth/Lips) indicate trend state.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Williams Alligator is a trend-following system that uses three Smoothed Moving Averages (SMMA/RMA) with different periods and forward display offsets to visualize market phases. The Jaw (13-period, offset 8), Teeth (8-period, offset 5), and Lips (5-period, offset 3) create a layered structure where intertwined lines indicate consolidation ("sleeping") and separated, aligned lines indicate trending conditions ("eating"). The metaphor maps directly to position management: stay out when the alligator sleeps, ride when it eats. Each line uses Wilder's smoothing ($\alpha = 1/N$), which is heavier than standard EMA, providing superior noise rejection at the cost of additional lag.
@@ -131,4 +129,4 @@ Three independent recursive streams. No cross-stream dependencies, but each stre
- Williams, B. — *Trading Chaos* (John Wiley & Sons, 1995)
- Williams, B. — *New Trading Dimensions* (John Wiley & Sons, 1998)
- PineScript reference: `alligator.pine` in indicator directory
- PineScript reference: `alligator.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [amat.pine](amat.pine) |
- The Archer Moving Averages Trends indicator is a triple-confirmation trend identification system that uses dual EMAs to produce discrete directiona...
- Parameterized by `fastperiod` (default 10), `slowperiod` (default 50).
- Output range: Varies (see docs).
- Requires `slowPeriod` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Alligator](../alligator/Alligator.md), [Ichimoku](../ichimoku/Ichimoku.md) | **Complementary:** ADX for trend strength | **Trading note:** Archer Moving Average Trend; uses MA crossover zones to classify trend phases.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Archer Moving Averages Trends indicator is a triple-confirmation trend identification system that uses dual EMAs to produce discrete directional signals (+1 bullish, -1 bearish, 0 neutral). Unlike simple crossover systems that trigger on any intersection, AMAT requires alignment of three conditions: relative position (fast above/below slow), fast EMA direction (rising/falling), and slow EMA direction (rising/falling). This triple gate filters out the whipsaw endemic to single-condition crossover systems in ranging markets. A secondary output quantifies trend strength as the percentage separation between EMAs, providing a conviction metric for position sizing.
@@ -121,4 +119,4 @@ Both EMA passes are recursive and sequential. The final comparison step is trivi
## Resources
- Joseph, T. — AMAT trend confirmation methodology (2009)
- PineScript reference: `amat.pine` in indicator directory
- PineScript reference: `amat.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [aroon.pine](aroon.pine) |
- The Aroon indicator measures the temporal freshness of price extremes, answering not "how much did price move?" but "how long ago did it make a new...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [AroonOsc](../aroonosc/AroonOsc.md), [ADX](../adx/Adx.md) | **Complementary:** Volume for confirmation | **Trading note:** Aroon Up/Down measures time since highest high or lowest low; 100 = new high/low this period.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Aroon indicator measures the temporal freshness of price extremes, answering not "how much did price move?" but "how long ago did it make a new high or low?" Aroon Up tracks the recency of the highest high within the lookback window; Aroon Down tracks the recency of the lowest low. Both are normalized to 0-100 where 100 means the extreme occurred on the current bar and 0 means it occurred at the far edge of the window. A companion Aroon Oscillator (Up minus Down) provides a single zero-centered metric for trend bias. Unlike recursive indicators that accumulate floating-point drift, Aroon is purely windowed — its value depends only on data within the lookback period, making it immune to initialization artifacts.
@@ -120,4 +118,4 @@ Batch mode with SIMD prefix-max/min and horizontal ArgMax achieves ~4× throughp
- Chande, T.S. — *Beyond Technical Analysis* (John Wiley & Sons, 1995)
- Chande, T.S. — *The New Technical Trader* (John Wiley & Sons, 1995)
- PineScript reference: `aroon.pine` in indicator directory
- PineScript reference: `aroon.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [aroonosc.pine](aroonosc.pine) |
- The Aroon Oscillator condenses the dual-line Aroon system into a single zero-centered value by computing $\text{AroonUp} - \text{AroonDown}$.
- Parameterized by `period`.
- Output range: $-100$ to $+100$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Aroon](../aroon/Aroon.md), [CMO](../../momentum/cmo/Cmo.md) | **Complementary:** ADX for trend strength | **Trading note:** Aroon Up minus Aroon Down; positive = uptrend, negative = downtrend.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Aroon Oscillator condenses the dual-line Aroon system into a single zero-centered value by computing $\text{AroonUp} - \text{AroonDown}$. This distills the temporal battle between fresh highs and fresh lows into a bounded $[-100, +100]$ metric where positive values indicate bullish recency dominance and negative values indicate bearish. Unlike recursive indicators that accumulate floating-point drift, the Aroon Oscillator is purely windowed — its value depends only on data within the lookback period, making it stateless in the long term and immune to initialization poisoning. The step-function output reflects discrete events (new extremes appearing or aging out) rather than smooth price trajectories.
@@ -114,4 +112,4 @@ Trivially parallelizable subtraction step after Aroon computation.
- Chande, T.S. — *The New Technical Trader* (John Wiley & Sons, 1995)
- Chande, T.S. — *Beyond Technical Analysis* (John Wiley & Sons, 1995)
- PineScript reference: `aroonosc.pine` in indicator directory
- PineScript reference: `aroonosc.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [chop.pine](chop.pine) |
- The Choppiness Index is a non-directional regime indicator that measures whether the market is trending or trading sideways.
- Parameterized by `period` (default 14).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [VHF](../vhf/Vhf.md) | **Complementary:** BBands for range boundaries | **Trading note:** Choppiness Index; high values = choppy/ranging, low values = trending. Range 0100.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Choppiness Index is a non-directional regime indicator that measures whether the market is trending or trading sideways. It compares total price movement (sum of True Range) to net price movement (high-low channel width) using a logarithmic ratio, producing a bounded value where high readings indicate choppy/consolidating conditions and low readings indicate trending conditions. CHOP does not indicate direction — only whether directional strategies are likely to succeed. The logarithmic scaling normalizes the output to approximately 0-100 regardless of price level or volatility magnitude.
@@ -120,4 +118,4 @@ With AVX2 and Intel SVML for vectorized log, batch mode achieves ~3× throughput
## Resources
- Dreiss, E.W. — Choppiness Index (original development)
- PineScript reference: `chop.pine` in indicator directory
- PineScript reference: `chop.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [dmx.pine](dmx.pine) |
- The DMX is Mark Jurik's modernized overhaul of Wilder's Directional Movement system, replacing the sluggish RMA smoothing with the Jurik Moving Ave...
- Parameterized by `period`.
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [DX](../dx/Dx.md) | **Complementary:** +DI/-DI for direction | **Trading note:** Directional Movement extended; enhanced version of Wilder's DM system.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The DMX is Mark Jurik's modernized overhaul of Wilder's Directional Movement system, replacing the sluggish RMA smoothing with the Jurik Moving Average (JMA) to achieve faster trend detection with superior noise rejection. The core directional movement logic (+DM, -DM, True Range) is preserved faithfully from Wilder, but the three parallel smoothing passes use JMA's adaptive bandwidth instead of RMA's fixed $\alpha = 1/N$. The result is a directional indicator that reacts 3-5 bars earlier to trend changes than standard DMI while filtering out more noise during consolidation. Output is the difference between smoothed directional indicators: $DMX = DI^+ - DI^-$, positive for uptrends and negative for downtrends.
@@ -131,4 +129,4 @@ Same constraint as ADX: the recursive RMA smoothing blocks cross-bar SIMD.
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- Jurik, M. — JMA adaptive smoothing methodology
- PineScript reference: `dmx.pine` in indicator directory
- PineScript reference: `dmx.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [dx.pine](dx.pine) |
- The Directional Movement Index is the raw, unsmoothed measure of trend strength from Wilder's directional movement system.
- Parameterized by `period` (default 14).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [ADXR](../adxr/Adxr.md) | **Complementary:** +DI/-DI for direction | **Trading note:** Directional Index; unsmoothed ADX. More responsive but noisier.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Directional Movement Index is the raw, unsmoothed measure of trend strength from Wilder's directional movement system. It decomposes price expansion into +DM and -DM, normalizes against True Range using RMA smoothing to produce +DI and -DI, then computes the ratio $DX = 100 \times |{+DI - {-DI}}| / ({+DI + {-DI}})$. Unlike ADX, which applies a final RMA pass to DX, the raw DX responds immediately to changes in directional dominance — making it noisier but approximately one full period faster. Output ranges from 0 to 100, where high values indicate strong directional movement regardless of up/down direction. DX is the building block from which ADX is derived.
@@ -139,4 +137,4 @@ Same RMA bottleneck as ADX. The DX formula itself is fully vectorizable.
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `dx.pine` in indicator directory
- PineScript reference: `dx.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ghla.pine](ghla.pine) |
- The Gann High-Low Activator (GHLA) is a trend-following stop/reversal indicator that alternates between the Simple Moving Average of Highs and the ...
- Parameterized by `period` (default 13).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Super](../super/Super.md), [PSAR](../../reversals/psar/Psar.md) | **Complementary:** ATR for stop placement | **Trading note:** Gann High-Low Activator; trend-following stop based on prior period's median.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Gann High-Low Activator (GHLA) is a trend-following stop/reversal indicator that alternates between the Simple Moving Average of Highs and the Simple Moving Average of Lows based on a three-state crossover rule. Developed by Robert Krausz and published in *Technical Analysis of Stocks & Commodities* (February 1998), the indicator produces a single trailing line: SMA(Low) during uptrends (acting as dynamic support) and SMA(High) during downtrends (acting as dynamic resistance). The flip between states occurs only when price closes decisively beyond the opposing SMA, creating a hysteresis zone that filters minor whipsaws. With a default period of 3 bars, GHLA responds aggressively to trend changes while requiring just $O(N)$ additions and one comparison per bar.
@@ -220,4 +218,4 @@ Key validation points:
- Gann, W.D. *Truth of the Stock Tape.* Financial Guardian Publishing, 1923.
- TradeStation. "HiLoActivator Study Reference." TradeStation Help Center.
- financial-hacker.com. "Petra on Programming: The Gann Hi-Lo Activator." 2020.
- PineScript reference: `ghla.pine` in indicator directory.
- PineScript reference: `ghla.pine` in indicator directory.
+1 -3
View File
@@ -14,8 +14,6 @@
- The Hilbert Transform Trend Mode indicator is a binary regime classifier that determines whether price action is dominated by trending behavior (ou...
- No configurable parameters; computation is stateless per bar.
- Output range: $0$ to $1$.
- Requires `LOOKBACK` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Hilbert Transform Trend Mode indicator is a binary regime classifier that determines whether price action is dominated by trending behavior (output = 1) or cyclical/mean-reverting behavior (output = 0). It uses the full Ehlers Hilbert Transform pipeline — 4-bar WMA smoothing, Hilbert FIR filters, homodyne discriminator for period estimation, DC phase extraction, and SineWave indicators — then applies four decision criteria to classify the current regime. The implementation follows TA-Lib's Ehlers-faithful algorithm from the February 2002 publication. Output is discrete {0, 1}, making it a direct strategy selector: deploy trend-following logic when mode = 1, and mean-reversion logic when mode = 0.
@@ -152,4 +150,4 @@ The recursive EMA smoothing of the period estimate blocks full vectorization.
- Ehlers, J.F. — "The Instantaneous Trendline" (February 2002)
- Ehlers, J.F. — *MESA and Trading Market Cycles* (John Wiley & Sons, 2002)
- Ehlers, J.F. — *Rocket Science for Traders* (John Wiley & Sons, 2001)
- PineScript reference: `ht_trendmode.pine` in indicator directory
- PineScript reference: `ht_trendmode.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ichimoku.pine](ichimoku.pine) |
- Ichimoku Kinko Hyo ("One Glance Equilibrium Chart") is a comprehensive trend-following system that provides five distinct components revealing tren...
- Parameterized by `tenkanperiod`, `kijunperiod`, `senkoubperiod`, `displacement`.
- Output range: Varies (see docs).
- Requires `maxPeriod` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Alligator](../alligator/Alligator.md), [AMAT](../amat/Amat.md) | **Complementary:** Volume for cloud breakout confirmation | **Trading note:** Five-line system: Tenkan, Kijun, Senkou A/B, Chikou. Cloud defines support/resistance zones.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Ichimoku Kinko Hyo ("One Glance Equilibrium Chart") is a comprehensive trend-following system that provides five distinct components revealing trend direction, momentum, support/resistance levels, and potential future price zones simultaneously. The Tenkan-sen and Kijun-sen are midpoints of high-low ranges at different timescales (not moving averages of closes). Senkou Span A and B form the "cloud" (Kumo) — a projected equilibrium zone displaced forward in time. Chikou Span is simply the current close displaced backward. All components use sliding window min/max arithmetic, producing step-function behavior on breakouts rather than the smooth curves of EMA-based systems. The system requires OHLC bar input.
@@ -148,4 +146,4 @@ Three independent window extremum computations can be parallelized. The midpoint
- Hosoda, G. — *Ichimoku Kinko Hyo* (7-volume series, Tokyo, 1969)
- Patel, M. — *Trading with Ichimoku Clouds* (John Wiley & Sons, 2010)
- Elliott, N. — *Ichimoku Charts: An Introduction* (Harriman House, 2007)
- PineScript reference: `ichimoku.pine` in indicator directory
- PineScript reference: `ichimoku.pine` in indicator directory
+1 -4
View File
@@ -12,9 +12,6 @@
| **Warmup** | `Math.Max(emaPeriod, macdSlow) + macdSignal - 1` bars (default 34) |
- The Elder Impulse System combines a 13-period EMA (trend inertia) with the MACD(12,26,9) histogram (momentum acceleration) to classify each bar as ...
- Parameterized by `emaperiod` (default 13), `macdfast` (default 12), `macdslow` (default 26), `macdsignal` (default 9).
- Output range: Varies (see docs).
- Requires `Math.Max(emaPeriod, macdSlow) + macdSignal - 1` bars (default 34) of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Elder Impulse System combines a 13-period EMA (trend inertia) with the MACD(12,26,9) histogram (momentum acceleration) to classify each bar as bullish (+1), bearish (-1), or neutral (0). Both EMA slope and histogram slope must agree for a directional signal; disagreement forces neutral. The system functions as a permission filter rather than a signal generator, requiring 34 bars warmup and running at O(1) per bar through composition of two child indicators.
@@ -131,4 +128,4 @@ Same EMA constraint across all impulse components.
- Elder, A. (2002). *Come Into My Trading Room*. John Wiley and Sons.
- Appel, G. (1979). "The Moving Average Convergence-Divergence Method."
- Aspray, T. (1986). "MACD Histogram." *Technical Analysis of Stocks and Commodities*.
- Aspray, T. (1986). "MACD Histogram." *Technical Analysis of Stocks and Commodities*.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [minusdi.pine](minusdi.pine) |
- The Minus Directional Indicator measures the strength of downward price movement relative to true range.
- Parameterized by `period` (default 14).
- Output range: 0 to 100.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [PlusDi](../plusdi/PlusDi.md), [ADX](../adx/Adx.md) | **Complementary:** ADX for trend strength | **Trading note:** Minus Directional Indicator; measures downward movement strength. Part of Wilder's DM system.
- Validated against TA-Lib, Skender, and Dx equivalence.
The Minus Directional Indicator (-DI) is one component of J. Welles Wilder Jr.'s Directional Movement System. It quantifies the fraction of recent true range attributable to downward price extension. The computation smooths both -DM (minus directional movement) and TR (true range) with Wilder's RMA ($\alpha = 1/N$), then divides: $-DI = 100 \times \text{Smooth}(-DM) / \text{Smooth}(TR)$. When -DI rises, downward price pressure is increasing. When -DI crosses above +DI, it signals a potential bearish trend. The -DI line is commonly plotted alongside +DI to visualize directional balance.
@@ -97,4 +95,4 @@ When $TR_{\text{smooth}} = 0$ (no price movement), -DI = 0.
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `minusdi.pine` in indicator directory
- PineScript reference: `minusdi.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [minusdm.pine](minusdm.pine) |
- Minus Directional Movement outputs the Wilder-smoothed downward directional movement in price units.
- Parameterized by `period` (default 14).
- Output range: ≥ 0 (price units, scales with instrument).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [PlusDm](../plusdm/PlusDm.md), [DX](../dx/Dx.md) | **Complementary:** ATR for normalization | **Trading note:** Minus Directional Movement; raw downward price expansion before smoothing.
- Validated against TA-Lib and Dx equivalence.
Minus Directional Movement (-DM) measures the magnitude of downward price movement, smoothed using Wilder's method. Unlike -DI which normalizes by true range to produce a percentage, -DM outputs raw smoothed values in price units. -DM captures when the previous bar's low exceeds the current bar's low by more than the current bar's high exceeds the previous bar's high. It is the raw building block of the Directional Movement System — the unnormalized signal before division by True Range converts it to -DI.
@@ -89,4 +87,4 @@ $$-DM_{\text{smooth}} = \text{RMA}(-DM, N), \quad \alpha = 1/N$$
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `minusdm.pine` in indicator directory
- PineScript reference: `minusdm.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [pfe.pine](pfe.pine) |
- Polarized Fractal Efficiency (PFE) quantifies trend strength by comparing the Euclidean distance a price series actually travels bar-to-bar against...
- Parameterized by `period` (default 10), `smoothperiod` (default 5).
- Output range: Varies (see docs).
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [VHF](../vhf/Vhf.md) | **Complementary:** Moving average for trend direction | **Trading note:** Polarized Fractal Efficiency; measures how efficiently price travels. ±100 scale.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Polarized Fractal Efficiency (PFE) quantifies trend strength by comparing the Euclidean distance a price series actually travels bar-to-bar against the straight-line distance between the endpoints over the same window. The ratio, scaled to [-100, +100] and smoothed with an EMA, distinguishes efficient trending motion (values near ±100) from fractal, self-similar noise (values near 0). Created by Hans Hannula and published in *Technical Analysis of Stocks & Commodities* (January 1994), PFE applies fractal geometry to price action without requiring Hurst exponent estimation or rescaled-range analysis. With default parameters (period=10, smooth=5), the indicator needs 11 close values for the first raw reading plus 5 bars of EMA convergence, totaling ~16 bars of warmup. The core loop executes $N$ square roots per bar, making it $O(N)$ per update in streaming mode.
@@ -251,4 +249,4 @@ Key validation points:
- Mandelbrot, Benoit. "The Variation of Certain Speculative Prices." *The Journal of Business*, Vol. 36, No. 4, October 1963.
- Kaufman, Perry. *Trading Systems and Methods*, 5th Edition. Wiley, 2013. (Efficiency Ratio comparison)
- Hannula, Hans. "Chaos and the Stock Market." *Cycles Magazine*, 1993.
- PineScript reference: `pfe.pine` in indicator directory.
- PineScript reference: `pfe.pine` in indicator directory.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [plusdi.pine](plusdi.pine) |
- The Plus Directional Indicator measures the strength of upward price movement relative to true range.
- Parameterized by `period` (default 14).
- Output range: 0 to 100.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MinusDi](../minusdi/MinusDi.md), [ADX](../adx/Adx.md) | **Complementary:** ADX for trend strength | **Trading note:** Plus Directional Indicator; measures upward movement strength. Part of Wilder's DM system.
- Validated against TA-Lib, Skender, and Dx equivalence.
The Plus Directional Indicator (+DI) is one component of J. Welles Wilder Jr.'s Directional Movement System. It quantifies the fraction of recent true range attributable to upward price extension. The computation smooths both +DM (plus directional movement) and TR (true range) with Wilder's RMA ($\alpha = 1/N$), then divides: $+DI = 100 \times \text{Smooth}(+DM) / \text{Smooth}(TR)$. When +DI rises, upward price pressure is increasing. When +DI crosses above -DI, it signals a potential bullish trend. The +DI line is commonly plotted alongside -DI to visualize directional balance.
@@ -97,4 +95,4 @@ When $TR_{\text{smooth}} = 0$ (no price movement), +DI = 0.
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `plusdi.pine` in indicator directory
- PineScript reference: `plusdi.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [plusdm.pine](plusdm.pine) |
- Plus Directional Movement outputs the Wilder-smoothed upward directional movement in price units.
- Parameterized by `period` (default 14).
- Output range: ≥ 0 (price units, scales with instrument).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MinusDm](../minusdm/MinusDm.md), [DX](../dx/Dx.md) | **Complementary:** ATR for normalization | **Trading note:** Plus Directional Movement; raw upward price expansion before smoothing.
- Validated against TA-Lib and Dx equivalence.
Plus Directional Movement (+DM) measures the magnitude of upward price movement, smoothed using Wilder's method. Unlike +DI which normalizes by true range to produce a percentage, +DM outputs raw smoothed values in price units. +DM captures when the current bar's high exceeds the previous bar's high by more than the previous bar's low exceeds the current bar's low. It is the raw building block of the Directional Movement System — the unnormalized signal before division by True Range converts it to +DI.
@@ -89,4 +87,4 @@ $$+DM_{\text{smooth}} = \text{RMA}(+DM, N), \quad \alpha = 1/N$$
## Resources
- Wilder, J.W. — *New Concepts in Technical Trading Systems* (Trend Research, 1978)
- PineScript reference: `plusdm.pine` in indicator directory
- PineScript reference: `plusdm.pine` in indicator directory
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [qstick.pine](qstick.pine) |
- The Qstick indicator, developed by Tushar Chande, computes a moving average of the close-minus-open difference over a lookback period, quantifying ...
- Parameterized by `period` (default defaultperiod), `useema` (default defaultuseema).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [CMO](../../momentum/cmo/Cmo.md), [Impulse](../impulse/Impulse.md) | **Complementary:** Volume for confirmation | **Trading note:** Qstick averages (CloseOpen); positive = buying pressure, negative = selling pressure.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Qstick indicator, developed by Tushar Chande, computes a moving average of the close-minus-open difference over a lookback period, quantifying whether bars are predominantly bullish or bearish. Positive values indicate closes above opens (buying pressure); negative values indicate closes below opens (selling pressure). It supports both SMA (O(N) space via ring buffer) and EMA (O(1) space) smoothing modes and requires TBar input for open/close access.
@@ -114,4 +112,4 @@ Fully SIMD-vectorizable in batch mode. AVX2 achieves ~4× throughput on large ar
## Resources
- Chande, T. S. & Kroll, S. (1994). *The New Technical Trader*. John Wiley and Sons.
- Kirkpatrick, C. D. & Dahlquist, J. R. (2015). *Technical Analysis: The Complete Resource for Financial Market Technicians*. FT Press.
- Kirkpatrick, C. D. & Dahlquist, J. R. (2015). *Technical Analysis: The Complete Resource for Financial Market Technicians*. FT Press.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [ravi.pine](ravi.pine) |
- RAVI (Range Action Verification Index) measures trend strength by computing the absolute percentage divergence between a short-period SMA and a lon...
- Parameterized by `shortperiod` (default 7), `longperiod` (default 65).
- Output range: Varies (see docs).
- Requires `longPeriod` bars (default 65) of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [Chop](../chop/Chop.md) | **Complementary:** Moving average crossover for entries | **Trading note:** Range Action Verification Index; ratio of fast/slow MA difference to slow MA. Trend filter.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
RAVI (Range Action Verification Index) measures trend strength by computing the absolute percentage divergence between a short-period SMA and a long-period SMA. Created by Tushar Chande and published in *Beyond Technical Analysis* (Wiley, 2001), the indicator classifies markets into trending (RAVI > 3%) and ranging (RAVI < 3%) regimes using a single threshold. With default parameters (short=7, long=65), RAVI requires 65 bars of warmup for the first valid reading. The core computation is three operations per bar in streaming mode: two running-sum updates and one division. No square roots, no exponentials, no recursion. The entire indicator reduces to normalized SMA spread, making it one of the cheapest dynamics classifiers available.
@@ -247,4 +245,4 @@ Key validation points:
- Chande, Tushar S. "Adapting Moving Averages to Market Volatility." *Stocks & Commodities*, V10:3, 1992. pp. 108-114. (VIDYA introduction; RAVI is the companion trend classifier.)
- Chande, Tushar S., and Kroll, Stanley. *The New Technical Trader: Boost Your Profit by Plugging into the Latest Indicators*. John Wiley & Sons, 1994. ISBN: 0471597805.
- Wilder, J. Welles. *New Concepts in Technical Trading Systems*. Trend Research, 1978. (ADX reference for comparison.)
- PineScript reference: `ravi.pine` in indicator directory.
- PineScript reference: `ravi.pine` in indicator directory.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [super.pine](super.pine) |
- SuperTrend is a trend-following overlay that uses ATR-scaled bands around the HL2 midpoint, switching between upper and lower bands based on close ...
- Parameterized by `period` (default 10), `multiplier` (default 3.0).
- Output range: Varies (see docs).
- Requires `> period + 1` bars of warmup before first valid output (IsHot = true).
- **Similar:** [PSAR](../../reversals/psar/Psar.md), [Ghla](../ghla/Ghla.md) | **Complementary:** ADX for trend strength | **Trading note:** SuperTrend; ATR-based trailing stop that flips direction. Popular in crypto and forex.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
SuperTrend is a trend-following overlay that uses ATR-scaled bands around the HL2 midpoint, switching between upper and lower bands based on close price breakouts. A ratchet mechanism prevents the active band from moving against the trend, creating a step-like trailing stop that adapts to volatility. The indicator is a two-state machine (bullish/bearish) with O(1) per-bar updates and zero allocations in the hot path.
@@ -127,4 +125,4 @@ The ratchet and trend-flip logic create strong sequential dependencies. The ATR
## Resources
- Seban, O. SuperTrend indicator documentation.
- Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Trend Research.
- Wilder, J. W. (1978). *New Concepts in Technical Trading Systems*. Trend Research.
+1 -4
View File
@@ -12,9 +12,6 @@
| **Warmup** | `Math.Max(Math.Max(bbPeriod, kcPeriod), momPeriod)` bars |
- John Carter's TTM Squeeze detects low-volatility compression by comparing Bollinger Band width against Keltner Channel width: when BB fits inside K...
- Parameterized by `bbperiod` (default 20), `bbmult` (default 2.0), `kcperiod` (default 20), `kcmult` (default 1.5), `momperiod` (default 20).
- Output range: Varies (see docs).
- Requires `Math.Max(Math.Max(bbPeriod, kcPeriod), momPeriod)` bars of warmup before first valid output (IsHot = true).
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
John Carter's TTM Squeeze detects low-volatility compression by comparing Bollinger Band width against Keltner Channel width: when BB fits inside KC, a "squeeze" is on, signaling imminent breakout. The momentum component uses linear regression of price deviation from the Donchian midline to indicate direction. The indicator outputs a boolean squeeze state plus a continuous momentum histogram, requiring BB(20,2.0) and KC(20,1.5) as default parameters with a combined warmup of 20 bars.
@@ -139,4 +136,4 @@ Regression can be recast as prefix-sum dot products for SIMD acceleration; ATR/E
- Carter, J. (2005). *Mastering the Trade*. McGraw-Hill.
- Bollinger, J. (2001). *Bollinger on Bollinger Bands*. McGraw-Hill.
- Keltner, C. (1960). *How to Make Money in Commodities*. The Keltner Statistical Service.
- Keltner, C. (1960). *How to Make Money in Commodities*. The Keltner Statistical Service.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [TtmTrend.pine](TtmTrend.pine) |
- John Carter's TTM Trend uses a fast EMA (default period 6) applied to typical price (HLC/3) to determine short-term trend direction via slope sign.
- Parameterized by `period` (default defaultperiod).
- Output range: Varies (see docs).
- Requires `> 2` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Impulse](../impulse/Impulse.md), [AMAT](../amat/Amat.md) | **Complementary:** TTM Squeeze for timing | **Trading note:** John Carter's trend indicator; colors bars based on close vs midpoint of prior 5-bar range.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
John Carter's TTM Trend uses a fast EMA (default period 6) applied to typical price (HLC/3) to determine short-term trend direction via slope sign. Output is a ternary trend state: +1 (bullish, EMA rising), -1 (bearish, EMA falling), or 0 (neutral, EMA unchanged). The indicator requires only 2 bars warmup, runs at O(1) per bar with O(1) space, and produces zero allocations in the hot path.
@@ -119,4 +117,4 @@ The EMA histogram is the only sequential step. SMA and comparison are fully vect
## Resources
- Carter, J. (2005). *Mastering the Trade*. McGraw-Hill.
- Carter, J. (2005). *Mastering the Trade*. McGraw-Hill.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [vhf.pine](vhf.pine) |
- VHF (Vertical Horizontal Filter) measures trend strength by dividing the price range over $N$ periods by the total absolute bar-to-bar path distanc...
- Parameterized by `period` (default 28).
- Output range: Varies (see docs).
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [Chop](../chop/Chop.md) | **Complementary:** Moving averages for direction | **Trading note:** Vertical Horizontal Filter; ratio of price range to cumulative movement. High = trending.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
VHF (Vertical Horizontal Filter) measures trend strength by dividing the price range over $N$ periods by the total absolute bar-to-bar path distance over the same window. Created by Adam White and published in the August 1991 issue of *Futures* magazine, VHF produces a single positive value where higher readings indicate trending conditions and lower readings indicate choppy, range-bound markets. With the default period of 28, the indicator requires 29 close values for the first valid output. The core computation in streaming mode is O(1) per bar when implemented with deque-based min/max tracking and a running sum of absolute changes. No square roots, no exponentials, no recursion. VHF is one of the simplest and cheapest trend-strength classifiers available, requiring approximately 12 operations per bar at steady state.
@@ -234,4 +232,4 @@ Key validation points:
- Dreiss, Bill. "Choppiness Index." Referenced in various technical analysis encyclopedias. No formal publication; oral tradition via market conferences circa 1993.
- Wilder, J. Welles. *New Concepts in Technical Trading Systems*. Trend Research, 1978. (ADX reference for comparison.)
- Pardo, Robert. *The Evaluation and Optimization of Trading Strategies*, 2nd Edition. Wiley, 2008. (Uses VHF as a regime filter in walk-forward optimization framework.)
- PineScript reference: `vhf.pine` in indicator directory.
- PineScript reference: `vhf.pine` in indicator directory.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [vortex.pine](vortex.pine) |
- The Vortex Indicator measures upward and downward trend momentum by computing the ratio of positive and negative vortex movements to true range ove...
- Parameterized by `period` (default 14).
- Output range: Varies (see docs).
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [ADX](../adx/Adx.md), [Aroon](../aroon/Aroon.md) | **Complementary:** Volume for confirmation | **Trading note:** VI+ and VI oscillate around 1.0; crossovers signal trend changes. Inspired by Viktor Schauberger's vortex theory.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Vortex Indicator measures upward and downward trend momentum by computing the ratio of positive and negative vortex movements to true range over a rolling window. VI+ captures the distance from current high to previous low (upward force); VI- captures the distance from current low to previous high (downward force). Both are normalized by summed true range, producing two lines that oscillate around 1.0. Crossovers signal trend changes. The implementation uses three ring buffers with running sums for O(1) streaming updates.
@@ -140,4 +138,4 @@ All individual-bar computations are independent and SIMD-friendly. The prefix-su
## Resources
- Botes, E. & Siepman, D. (2010). "The Vortex Indicator." *Technical Analysis of Stocks and Commodities*, January 2010.
- Botes, E. & Siepman, D. (2010). "The Vortex Indicator." *Technical Analysis of Stocks and Commodities*, January 2010.
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [huber.pine](huber.pine) |
- Huber Loss is a hybrid loss function that combines the best properties of Mean Squared Error (MSE) and Mean Absolute Error (MAE).
- Parameterized by `period`, `delta` (default 1.345).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [PseudoHuber](../pseudohuber/PseudoHuber.md), [MAE](../mae/Mae.md) | **Trading note:** Huber loss; robust to outliers — quadratic for small errors, linear for large. Used in ML-based trading models.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Huber Loss is a hybrid loss function that combines the best properties of Mean Squared Error (MSE) and Mean Absolute Error (MAE). For small errors, it behaves quadratically like MSE; for large errors, it behaves linearly like MAE.
@@ -188,4 +186,4 @@ huber.Update(110, 100); // Returns ~12.546
* [MAE](../mae/Mae.md) - Mean Absolute Error (linear everywhere)
* [MSE](../mse/Mse.md) - Mean Squared Error (quadratic everywhere)
* [RMSE](../rmse/Rmse.md) - Root Mean Squared Error
* [RMSE](../rmse/Rmse.md) - Root Mean Squared Error
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [logcosh.pine](logcosh.pine) |
- Log-Cosh Loss combines the best properties of L1 (absolute) and L2 (squared) error metrics through the logarithm of the hyperbolic cosine function.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [Huber](../huber/Huber.md), [MSE](../mse/Mse.md) | **Trading note:** Log-cosh loss; smooth approximation to MAE. Twice differentiable; preferred for gradient-based optimization.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Log-Cosh Loss combines the best properties of L1 (absolute) and L2 (squared) error metrics through the logarithm of the hyperbolic cosine function. It provides smooth gradients everywhere while remaining robust to outliers.
@@ -184,4 +182,4 @@ For large errors, Log-Cosh grows approximately linearly (like L1), avoiding the
* [MAE](../mae/Mae.md) - Mean Absolute Error (pure L1)
* [MSE](../mse/Mse.md) - Mean Squared Error (pure L2)
* [Huber](../huber/Huber.md) - Huber Loss (piecewise L1/L2)
* [PseudoHuber](../pseudohuber/PseudoHuber.md) - Smooth Huber approximation
* [PseudoHuber](../pseudohuber/PseudoHuber.md) - Smooth Huber approximation
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [maape.pine](maape.pine) |
- Mean Arctangent Absolute Percentage Error (MAAPE) transforms percentage errors through the arctangent function, naturally bounding the metric betwe...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MAPE](../mape/Mape.md), [SMAPE](../smape/Smape.md) | **Trading note:** Mean Arctangent Absolute Percentage Error; bounded and symmetric, handles zero values unlike MAPE.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Arctangent Absolute Percentage Error (MAAPE) transforms percentage errors through the arctangent function, naturally bounding the metric between 0 and π/2. This eliminates the unbounded nature of MAPE while preserving its scale-independence.
@@ -178,4 +176,4 @@ The arctangent compression means that the difference between 100% and 1000% erro
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error (unbounded)
* [SMAPE](../smape/Smape.md) - Symmetric MAPE (different bounding approach)
* [LogCosh](../logcosh/LogCosh.md) - Log-Cosh Loss (similar compression philosophy)
* [LogCosh](../logcosh/LogCosh.md) - Log-Cosh Loss (similar compression philosophy)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mae.pine](mae.pine) |
- Mean Absolute Error (MAE) measures the average magnitude of errors in a set of predictions, without considering their direction.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MSE](../mse/Mse.md), [MdAE](../mdae/Mdae.md) | **Trading note:** Mean Absolute Error; simple, interpretable forecast accuracy metric. Same units as input.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Absolute Error (MAE) measures the average magnitude of errors in a set of predictions, without considering their direction. It represents the average of the absolute differences between actual and predicted values.
@@ -160,4 +158,4 @@ Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized
* [MSE](../mse/Mse.md) - Mean Squared Error
* [RMSE](../rmse/Rmse.md) - Root Mean Squared Error
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mapd.pine](mapd.pine) |
- Mean Absolute Percentage Deviation (MAPD) measures the average absolute percentage difference between actual and predicted values, using the predic...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MAPE](../mape/Mape.md), [WMAPE](../wmape/Wmape.md) | **Trading note:** Mean Absolute Percentage Deviation; total absolute error divided by total actual values.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Absolute Percentage Deviation (MAPD) measures the average absolute percentage difference between actual and predicted values, using the predicted value as the denominator. This is the key difference from MAPE, which uses the actual value.
@@ -176,4 +174,4 @@ mapd.Update(200, 100); // |200-100|/100 = 100%
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error (divides by actual)
* [SMAPE](../smape/Smape.md) - Symmetric Mean Absolute Percentage Error
* [MPE](../mpe/Mpe.md) - Mean Percentage Error (signed)
* [MAE](../mae/Mae.md) - Mean Absolute Error (same units)
* [MAE](../mae/Mae.md) - Mean Absolute Error (same units)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mape.pine](mape.pine) |
- Mean Absolute Percentage Error (MAPE) measures the average absolute percentage difference between actual and predicted values.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [SMAPE](../smape/Smape.md), [MAAPE](../maape/Maape.md) | **Trading note:** Mean Absolute Percentage Error; scale-independent accuracy. Undefined when actuals are zero.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Absolute Percentage Error (MAPE) measures the average absolute percentage difference between actual and predicted values. It expresses accuracy as a percentage, making it scale-independent and easy to interpret.
@@ -192,4 +190,4 @@ Same absolute error (50), but over-prediction shows higher MAPE.
* [MAPD](../mapd/Mapd.md) - Mean Absolute Percentage Deviation (divides by predicted)
* [SMAPE](../smape/Smape.md) - Symmetric Mean Absolute Percentage Error
* [MPE](../mpe/Mpe.md) - Mean Percentage Error (signed)
* [MAE](../mae/Mae.md) - Mean Absolute Error (same units)
* [MAE](../mae/Mae.md) - Mean Absolute Error (same units)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mase.pine](mase.pine) |
- Mean Absolute Scaled Error (MASE) normalizes forecast errors by the average error of a naive "random walk" forecast (using the previous value as th...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period + 1` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MAE](../mae/Mae.md), [RAE](../rae/Rae.md) | **Trading note:** Mean Absolute Scaled Error; compares forecast to naïve random-walk baseline. <1 = better than naïve.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Absolute Scaled Error (MASE) normalizes forecast errors by the average error of a naive "random walk" forecast (using the previous value as the prediction). This makes MASE scale-independent and interpretable across different time series.
@@ -135,4 +133,4 @@ MASE is particularly valuable when:
* Comparing forecasts across different series
* Evaluating against a natural baseline (naive forecast)
* Working with data that includes zeros
* Needing symmetric treatment of over/under predictions
* Needing symmetric treatment of over/under predictions
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mdae.pine](mdae.pine) |
- Median Absolute Error (MdAE) measures the middle value of all absolute errors.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MAE](../mae/Mae.md), [MdAPE](../mdape/Mdape.md) | **Trading note:** Median Absolute Error; robust central-tendency error metric, resistant to outliers.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Median Absolute Error (MdAE) measures the middle value of all absolute errors. Unlike MAE which averages errors, MdAE finds the median, providing exceptional robustness against outliers and extreme values.
@@ -167,4 +165,4 @@ Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized
* [MAE](../mae/Mae.md) - Mean Absolute Error (uses mean)
* [MdAPE](../mdape/Mdape.md) - Median Absolute Percentage Error
* [Huber](../huber/Huber.md) - Huber Loss (robust but differentiable)
* [Huber](../huber/Huber.md) - Huber Loss (robust but differentiable)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mdape.pine](mdape.pine) |
- Median Absolute Percentage Error (MdAPE) combines the scale-independence of percentage errors with the robustness of median statistics.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MAPE](../mape/Mape.md), [MdAE](../mdae/Mdae.md) | **Trading note:** Median Absolute Percentage Error; robust version of MAPE for skewed error distributions.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Median Absolute Percentage Error (MdAPE) combines the scale-independence of percentage errors with the robustness of median statistics. It provides a measure of typical relative prediction accuracy that remains stable even when some predictions are dramatically wrong.
@@ -164,4 +162,4 @@ Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error (uses mean)
* [MdAE](../mdae/Mdae.md) - Median Absolute Error (non-percentage)
* [SMAPE](../smape/Smape.md) - Symmetric MAPE (different normalization)
* [SMAPE](../smape/Smape.md) - Symmetric MAPE (different normalization)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [me.pine](me.pine) |
- Mean Error (ME), also known as Mean Bias Error, measures the average error between actual and predicted values while preserving the sign.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MAE](../mae/Mae.md), [MPE](../mpe/Mpe.md) | **Trading note:** Mean Error (bias); positive = systematic overprediction, negative = underprediction.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Error (ME), also known as Mean Bias Error, measures the average error between actual and predicted values while preserving the sign. Unlike MAE, ME reveals systematic bias in predictions: whether a model consistently over-predicts or under-predicts.
@@ -179,4 +177,4 @@ Always use ME alongside MAE or MSE to get a complete picture.
* [MAE](../mae/Mae.md) - Mean Absolute Error (magnitude only)
* [MSE](../mse/Mse.md) - Mean Squared Error
* [MPE](../mpe/Mpe.md) - Mean Percentage Error (relative bias)
* [MPE](../mpe/Mpe.md) - Mean Percentage Error (relative bias)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mpe.pine](mpe.pine) |
- Mean Percentage Error measures the average percentage difference between actual and predicted values while preserving the sign.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [ME](../me/Me.md), [MAPE](../mape/Mape.md) | **Trading note:** Mean Percentage Error; reveals directional bias as percentage. Positive/negative cancellation is a feature.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Percentage Error measures the average percentage difference between actual and predicted values while preserving the sign. Unlike MAPE, which takes absolute values, MPE reveals systematic bias in predictions—whether a model consistently over-predicts or under-predicts.
@@ -176,4 +174,4 @@ Unlike MAPE (bounded at 0% to ∞), MPE can range from -∞ to +100%:
* [MAPE](../mape/Mape.md) - Unsigned percentage error for magnitude
* [ME](../me/Me.md) - Signed absolute error for absolute bias
* [MAE](../mae/Mae.md) - Unsigned absolute error for magnitude
* [MAE](../mae/Mae.md) - Unsigned absolute error for magnitude
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mrae.pine](mrae.pine) |
- Mean Relative Absolute Error (MRAE) measures the average magnitude of errors relative to the actual values.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [RAE](../rae/Rae.md), [MASE](../mase/Mase.md) | **Trading note:** Mean Relative Absolute Error; ratio of errors to benchmark errors. Scale-free comparison metric.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Relative Absolute Error (MRAE) measures the average magnitude of errors relative to the actual values. This normalization makes the metric scale-independent and easier to interpret across different datasets.
@@ -161,4 +159,4 @@ Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized
* [MAE](../mae/Mae.md) - Mean Absolute Error (non-relative)
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error
* [SMAPE](../smape/Smape.md) - Symmetric Mean Absolute Percentage Error
* [SMAPE](../smape/Smape.md) - Symmetric Mean Absolute Percentage Error
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [mse.pine](mse.pine) |
- Mean Squared Error (MSE) measures the average of the squares of the errors between actual and predicted values.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [RMSE](../rmse/Rmse.md), [MAE](../mae/Mae.md) | **Trading note:** Mean Squared Error; penalizes large errors quadratically. Standard loss function in regression.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Squared Error (MSE) measures the average of the squares of the errors between actual and predicted values. By squaring errors, MSE penalizes large deviations more heavily than small ones.
@@ -147,4 +145,4 @@ RMSE has the advantage of being in the same units as the original data.
* [MAE](../mae/Mae.md) - Mean Absolute Error (robust to outliers)
* [RMSE](../rmse/Rmse.md) - Root Mean Squared Error (same units as data)
* [Huber](../huber/Huber.md) - Combines MSE and MAE benefits
* [Huber](../huber/Huber.md) - Combines MSE and MAE benefits
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [msle.pine](msle.pine) |
- Mean Squared Logarithmic Error transforms both actual and predicted values through logarithms before computing squared error.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [RMSLE](../rmsle/Rmsle.md), [MSE](../mse/Mse.md) | **Trading note:** Mean Squared Log Error; penalizes under-prediction more than over-prediction. Good for growth rates.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Mean Squared Logarithmic Error transforms both actual and predicted values through logarithms before computing squared error. This compression makes MSLE robust to outliers and particularly suited for data with exponential growth patterns or wide dynamic ranges.
@@ -205,4 +203,4 @@ Near zero, small absolute differences create large MSLE:
* [RMSLE](../rmsle/Rmsle.md) - Root of MSLE for interpretable units
* [MSE](../mse/Mse.md) - Linear-scale squared error
* [MAPE](../mape/Mape.md) - Percentage-based comparison
* [MAPE](../mape/Mape.md) - Percentage-based comparison
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [pseudohuber.pine](pseudohuber.pine) |
- Pseudo-Huber Loss (also called Charbonnier Loss) is a smooth approximation to the Huber loss function.
- Parameterized by `period`, `delta` (default 1.0).
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [Huber](../huber/Huber.md), [LogCosh](../logcosh/LogCosh.md) | **Trading note:** Smooth approximation to Huber loss; continuously differentiable with tunable delta parameter.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Pseudo-Huber Loss (also called Charbonnier Loss) is a smooth approximation to the Huber loss function. Unlike Huber which has a piecewise definition with a kink at δ, Pseudo-Huber is continuously differentiable everywhere, making it ideal for gradient-based optimization.
@@ -191,4 +189,4 @@ Pseudo-Huber produces slightly smaller values but follows the same qualitative b
* [Huber](../huber/Huber.md) - Huber Loss (piecewise, with kink)
* [LogCosh](../logcosh/LogCosh.md) - Log-Cosh Loss (different smooth approximation)
* [MAE](../mae/Mae.md) - Mean Absolute Error (pure L1)
* [MSE](../mse/Mse.md) - Mean Squared Error (pure L2)
* [MSE](../mse/Mse.md) - Mean Squared Error (pure L2)
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [quantileloss.pine](quantileloss.pine) |
- Quantile Loss (also called Pinball Loss) measures prediction accuracy with asymmetric penalties for over-prediction versus under-prediction.
- Parameterized by `period`, `quantile` (default 0.5).
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MAE](../mae/Mae.md), [Huber](../huber/Huber.md) | **Trading note:** Asymmetric loss for quantile regression; set tau to penalize over/under-prediction differently.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Quantile Loss (also called Pinball Loss) measures prediction accuracy with asymmetric penalties for over-prediction versus under-prediction. It's essential for probabilistic forecasting where different quantiles of the distribution matter.
@@ -178,4 +176,4 @@ With τ=0.9, under-predictions are penalized 9x more than over-predictions.
* [MAE](../mae/Mae.md) - Mean Absolute Error (equivalent to τ=0.5 × 2)
* [Huber](../huber/Huber.md) - Huber Loss (robust symmetric)
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error
* [MAPE](../mape/Mape.md) - Mean Absolute Percentage Error
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [rae.pine](rae.pine) |
- Relative Absolute Error (RAE) measures the total absolute error of predictions relative to the total absolute error of a simple baseline predictor ...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MASE](../mase/Mase.md), [MRAE](../mrae/Mrae.md) | **Trading note:** Relative Absolute Error; total absolute error relative to naïve model. <1 = outperforms naïve.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Relative Absolute Error (RAE) measures the total absolute error of predictions relative to the total absolute error of a simple baseline predictor that always predicts the mean of actual values. This provides a normalized performance metric.
@@ -136,4 +134,4 @@ RAE is preferable when:
* You want robustness to outliers (absolute vs squared errors)
* You need a ratio interpretation (< 1 is good, > 1 is bad)
* The mean predictor is a relevant baseline for your domain
* The mean predictor is a relevant baseline for your domain
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [rmse.pine](rmse.pine) |
- Root Mean Squared Error (RMSE) is the square root of MSE, providing an error metric in the same units as the original data while retaining sensitiv...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires 1 bar of warmup before first valid output (IsHot = true).
- **Similar:** [MSE](../mse/Mse.md), [MAE](../mae/Mae.md) | **Trading note:** Root Mean Squared Error; same units as input, emphasizes large deviations. Most common accuracy metric.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Root Mean Squared Error (RMSE) is the square root of MSE, providing an error metric in the same units as the original data while retaining sensitivity to large errors.
@@ -76,4 +74,4 @@ Batch SIMD: 4x-8x speedup for large windows. ~3-5 cy/bar amortized in vectorized
## Related Indicators
* [MSE](../mse/Mse.md) - Mean Squared Error
* [MAE](../mae/Mae.md) - Mean Absolute Error
* [MAE](../mae/Mae.md) - Mean Absolute Error
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [rmsle.pine](rmsle.pine) |
- Root Mean Squared Logarithmic Error is the square root of MSLE, providing an error metric in log-scale units.
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MSLE](../msle/Msle.md), [RMSE](../rmse/Rmse.md) | **Trading note:** Root Mean Squared Log Error; measures relative error magnitude. Useful for price ratios.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Root Mean Squared Logarithmic Error is the square root of MSLE, providing an error metric in log-scale units. This makes RMSLE more interpretable than MSLE while retaining all its benefits for data spanning multiple orders of magnitude.
@@ -225,4 +223,4 @@ Small absolute values near zero can produce large RMSLE:
* [MSLE](../msle/Msle.md) - Squared version without root
* [RMSE](../rmse/Rmse.md) - Linear-scale root mean squared error
* [MAPE](../mape/Mape.md) - Percentage error without log transform
* [MAPE](../mape/Mape.md) - Percentage error without log transform
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [rse.pine](rse.pine) |
- Relative Squared Error (RSE) measures the total squared error of predictions relative to the total squared error of a simple baseline predictor tha...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [RMSE](../rmse/Rmse.md), [Rsquared](../rsquared/Rsquared.md) | **Trading note:** Relative Squared Error; normalized by variance of actuals. >1 = worse than mean prediction.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Relative Squared Error (RSE) measures the total squared error of predictions relative to the total squared error of a simple baseline predictor that always predicts the mean. RSE is directly related to the coefficient of determination (R²).
@@ -140,4 +138,4 @@ Rse.Batch(actualSpan, predictedSpan, outputSpan, 14);
| **Outlier sensitivity** | High | Low |
| **Related to** | R² | — |
| **Baseline** | Mean predictor | Mean predictor |
| **Interpretation** | 1 - R² | Better/worse than mean |
| **Interpretation** | 1 - R² | Better/worse than mean |
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [rsquared.pine](rsquared.pine) |
- The Coefficient of Determination (R²) measures the proportion of variance in the actual values that is predictable from the predicted values.
- Parameterized by `period`.
- Output range: $(-\infty, 1]$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [RSE](../rse/Rse.md), [Correlation](../../statistics/correlation/Correlation.md) | **Trading note:** R-squared (coefficient of determination); 1.0 = perfect fit, 0 = no better than mean.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
The Coefficient of Determination (R²) measures the proportion of variance in the actual values that is predictable from the predicted values. R² ranges from negative infinity to 1, where 1 indicates perfect predictions.
@@ -149,4 +147,4 @@ Rsquared.Batch(actualSpan, predictedSpan, outputSpan, 14);
* **Use R²** when you want an intuitive measure of model quality (0-1 scale for good models)
* **Use RSE** when you want to compare error magnitudes directly
* **Use both** to get complementary perspectives on model performance
* **Use both** to get complementary perspectives on model performance
+2 -4
View File
@@ -13,9 +13,7 @@
| **PineScript** | [smape.pine](smape.pine) |
- Symmetric Mean Absolute Percentage Error addresses a fundamental asymmetry in MAPE: the fact that over-predictions and under-predictions of the sam...
- Parameterized by `period`.
- Output range: $\geq 0$.
- Requires `period` bars of warmup before first valid output (IsHot = true).
- **Similar:** [MAPE](../mape/Mape.md), [MAAPE](../maape/Maape.md) | **Trading note:** Symmetric MAPE; bounded 0200%, handles zeros better than MAPE. Common in forecasting competitions.
- Validated against TA-Lib, Skender, and Tulip reference implementations where available.
Symmetric Mean Absolute Percentage Error addresses a fundamental asymmetry in MAPE: the fact that over-predictions and under-predictions of the same magnitude receive different penalties. SMAPE uses the average of actual and predicted values in the denominator, creating a metric that treats both directions equally.
@@ -182,4 +180,4 @@ This scales to 0-100% but is mathematically equivalent to the 0-200% version. Qu
* [MAPE](../mape/Mape.md) - Asymmetric percentage error
* [MPE](../mpe/Mpe.md) - Signed percentage error for bias
* [MAE](../mae/Mae.md) - Absolute error without scaling
* [MAE](../mae/Mae.md) - Absolute error without scaling

Some files were not shown because too many files have changed in this diff Show More