OPEN-SOURCE SCRIPT
Aggiornato EMA (Fractional Length EMA) [A II]

EMA (Fractional Length EMA)
Description
This is a standard Exponential Moving Average (EMA) with artificial length constraints removed. It preserves the classic EMA formula while allowing decimal and sub-1 length values. The goal is to provide a mathematically complete EMA implementation rather than a restricted preset.
Basic Formula (Pine)
Pine Script®
Key Features
■ Caveats
Sub-1 values do not behave like traditional smoothing EMAs.
Overshoot and higher reactivity are expected outcomes of the formula.
Practical use example
I use an EMA with n = 0.6 for responsiveness and then smooth it with a DEMA(12). The short length captures impulses quickly Whilst the higher length DEMA filters out noise whilst maintaining reactivity. This resembles a hybrid between an oscillator and a moving average, ideal for spotting momentum changes without being overwhelmed by noise.
🇯🇵 日本語概要(Japanese Summary)
本スクリプトは、EMA(指数移動平均)を数理仕様に忠実に実装した拡張版です。特徴として、期間パラメータに1未満を含む小数値を指定可能です。これにより、従来の整数期間では不可能だった極めて細かい重み付けの調整や、高速な応答特性のシミュレーションを実現します。計算式は標準的なEMAと同一であり、パラメータの制約のみを排除しています。
中文概要(Chinese Summary)
本指標為標準 EMA 的擴充實作,核心公式保持不變,但開放了小數與小於 1 的週期設定。透過取消整數限制,提供更微細的權重微調空間。小於 1 的週期在數學上依舊有效,可呈現不同的濾波動態。本工具旨在回歸 EMA 數理定義的完整靈活性,而非創造新指標。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk.
Description
This is a standard Exponential Moving Average (EMA) with artificial length constraints removed. It preserves the classic EMA formula while allowing decimal and sub-1 length values. The goal is to provide a mathematically complete EMA implementation rather than a restricted preset.
Basic Formula (Pine)
Key Features
- Decimal Lengths
Length accepts real numbers instead of integers. Provide finer control over weighting and transition between speeds— unlocks non-integer Fibonacci, golden ratio, or custom tuning. - Sub-1 Lengths (N < 1)
Allows smoothing factors greater than 1, which changes the filter’s response characteristics while remaining mathematically valid. When N < 1, the smoothing coefficient exceeds 1 and the recursive term becomes negative-weighted. In practice, the EMA overshoots the current price, then corrects in the opposite direction on the next bar, creating zig-zag oscillations around price. This enables:
■Strong responsiveness to change
■Impulse sensitivity
■Use within multi-pole or stacked filter designs
■Combination with slower averages for spread or difference constructions
■ Caveats
Sub-1 values do not behave like traditional smoothing EMAs.
Overshoot and higher reactivity are expected outcomes of the formula.
Practical use example
I use an EMA with n = 0.6 for responsiveness and then smooth it with a DEMA(12). The short length captures impulses quickly Whilst the higher length DEMA filters out noise whilst maintaining reactivity. This resembles a hybrid between an oscillator and a moving average, ideal for spotting momentum changes without being overwhelmed by noise.
🇯🇵 日本語概要(Japanese Summary)
本スクリプトは、EMA(指数移動平均)を数理仕様に忠実に実装した拡張版です。特徴として、期間パラメータに1未満を含む小数値を指定可能です。これにより、従来の整数期間では不可能だった極めて細かい重み付けの調整や、高速な応答特性のシミュレーションを実現します。計算式は標準的なEMAと同一であり、パラメータの制約のみを排除しています。
中文概要(Chinese Summary)
本指標為標準 EMA 的擴充實作,核心公式保持不變,但開放了小數與小於 1 的週期設定。透過取消整數限制,提供更微細的權重微調空間。小於 1 的週期在數學上依舊有效,可呈現不同的濾波動態。本工具旨在回歸 EMA 數理定義的完整靈活性,而非創造新指標。
Disclaimer:
This script is a research tool for market structure analysis and educational purposes only. It does not constitute financial advice. Trading involves risk.
Note di rilascio
1. Updated a typo in the EMA function.2. Under development: This indicator is planned to from the basis of a fractional length "noisy" carrier signal that is then fed through a Kalman filter.
Fractional length EMA with length at 0.1. A band forms around price showing the raw volatility or carrier signal of price.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.