mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 09:38:05 +00:00
Merge branch 'dev'
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 0–100.
|
||||
- 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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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*.
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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.
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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 (Close−Open); 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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user