OPEN-SOURCE SCRIPT
Inverse Fisher Transform on ADX DI (Directional Acceptance)

- **Purpose** — Implements an Inverse Fisher Transform (IFT) on the ADX Directional Index spread (plusDI − minusDI) to produce a bounded, smoothed oscillator that highlights directional dominance and makes extreme directional shifts easier to spot.
- **Core signal** — Uses the DMI spread as the raw input; positive values indicate upward directional dominance, negative values indicate downward dominance, and the IFT maps those tendencies into a compact \([-1, +1]\) range.
- **Normalization** — Normalizes the DI spread over a rolling window (`normLen`) by computing the windowed minimum and maximum, then rescales to \([0,1]\) and remaps to \([-1,1]\) so the IFT receives a stable, comparable input across different instruments and timeframes.
- **Clamping for stability** — Clamps the normalized input to \([-0.999, 0.999]\) before applying the exponential-based IFT formula to avoid numerical overflow and to keep the transform well-behaved near the boundaries.
- **Inverse Fisher Transform math** — Applies the standard IFT formula \((e^{2x}-1)/(e^{2x}+1)\) which accentuates extremes and compresses mid-range values, improving the visual separation between neutral and strong directional conditions.
- **Pre- and final smoothing** — Offers a two-stage smoothing approach: optional pre-smoothing of the normalized input to reduce spikes, followed by a final smoothing (RMA/EMA/WMA) of the IFT output to control responsiveness versus noise.
- **Smoothing options** — Supports Wilder RMA for trend stability, EMA for responsiveness, and WMA for weighted recency; this flexibility lets traders tune the indicator to their preferred balance of lag and sensitivity.
- **Visual enhancements** — Plots the smoothed IFT line with color coding for positive/negative values, optional histogram columns, horizontal threshold lines (e.g., ±0.5), and a filled area to emphasize the relationship to zero.
- **Alerting and signals** — Includes `alertcondition` triggers for crossings of the upper/lower thresholds and zero, enabling automated notifications when directional acceptance shifts materially in either direction.
- **Edge-case handling** — Gracefully handles flat normalization windows by returning a neutral midpoint (0.5 normalized) and uses a tiny epsilon-like clamp to avoid division-by-zero or degenerate outputs.
- **Tuning guidance** — Recommends larger `normLen` for less sensitivity to short-term swings, smaller smoothing lengths for faster signals, and threshold adjustments per instrument and timeframe to reduce false signals.
- **Performance considerations** — Keeps computations lightweight (min/max, simple transforms, standard moving averages) so the script runs efficiently even on lower timeframes or long historical ranges.
- **Interpretation tips** — Readings above the upper threshold indicate accepted upward dominance (bullish bias), readings below the lower threshold indicate accepted downward dominance (bearish bias), and zero crossings suggest shifts in directional control.
- **Extensions and variants** — Can be extended with percentile-based normalization, multi-timeframe DI inputs, ADX overlay for trend strength context, or adaptive thresholds; these additions can improve robustness but may increase complexity and computation.
- **Practical use** — Best used as a directional-confirmation tool alongside price action or trend filters; avoid using it as a lone entry signal on highly mean-reverting instruments without additional confirmation.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
Once a trader, always a speculator!!
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
Once a trader, always a speculator!!
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。