PROTECTED SOURCE SCRIPT
TFPV — FULL Radial Kernel MA (Short/Long, Time Folding, Colored)

TFPV is a pair of adaptive moving averages built with a radial kernel (Gaussian/Laplacian/Cauchy) on a joint metric of time, price, and volume. It can “fold” time along the market’s dominant cycle so that bars separated by entire cycles still contribute as if they were near each other—helpful for cyclical or range-bound markets. The short/long lines auto-color by regime and include cross alerts.
What it does
Radial-kernel averaging: Weights past bars by their distance from the current bar in a 3-axis space:
Time (αₜ): linear distance or cycle-aware phase distance
Price (αₚ): normalized by robust price scale
Volume (αᵥ): normalized by (log) volume scale
Time folding: Choose Linear (standard) or Circular using:
Homodyne (Hilbert) dominant period, or
ACF (autocorrelation) dominant period
This compresses distances for bars that are one or more full cycles apart, improving smoothing without lagging trends.
Adaptive scales: Price/volume bandwidths use Robust MAD, Stdev, or ATR. Optional Super Smoother center reduces noise before measuring distances.
Visual regime coloring: Short above Long → teal (bullish). Short below Long → orange (bearish). Optional fill highlights the spread.
How to read it
Trend filter: Trade in the direction of the color (teal bullish, orange bearish).
Crossovers: Short crossing above Long often marks early trend continuation after pullbacks; crossing below can warn of weakening momentum.
Spread width: A widening gap suggests strengthening trend; a shrinking gap hints at consolidation or a possible regime change.
Key settings
Lengths
Short/Long window: Lookback for each radial MA. Short reacts faster; Long stabilizes the regime.
Kernel & Metric
Kernel: Gaussian, Laplacian, or Cauchy (default). Cauchy is heavier-tailed (keeps more outliers), Gaussian is tighter.
Axis weights (αₜ, αₚ, αᵥ): Importance of time/price/volume distances. Increase a weight to make that axis matter more.
Ignore weights below: Hard cutoff for tiny kernel weights to speed up/clean contributions.
Time Folding
Topology: Linear (standard MA behavior) or Circular (Homodyne/ACF) (cycle-aware).
Cycle floor/ceil: Bounds for the dominant period search.
σₜ mode: Auto sets time bandwidth from the detected period (or length in Linear mode) × multiplier; Manual fixes σₜ in bars.
Price/Volume Scaling
Price scale: Robust MAD (outlier-resistant), Stdev, or ATR (trend-aware).
σₚ/σᵥ multipliers: Bandwidths for price/volume axes. Larger values = looser matching (smoother, more lag).
Use log(volume): Stabilizes volume’s scale across regimes; recommended.
Kernel Center
Price center: Raw (close) or Super Smoother to reduce noise before measuring price distance.
Plotting
Plot source: Show/hide the input source.
Fill between lines: Visual emphasis of the short/long spread.
Tips
Start with defaults: Cauchy, Circular (Homodyne), Robust MAD, log-volume on.
For choppy/cyclical symbols, Circular time folding often reduces false flips.
If signals feel too twitchy, either increase Short/Long lengths or raise σₚ/σᵥ multipliers (looser kernel).
For strong trends with regime shifts, try ATR price scaling.
What it does
Radial-kernel averaging: Weights past bars by their distance from the current bar in a 3-axis space:
Time (αₜ): linear distance or cycle-aware phase distance
Price (αₚ): normalized by robust price scale
Volume (αᵥ): normalized by (log) volume scale
Time folding: Choose Linear (standard) or Circular using:
Homodyne (Hilbert) dominant period, or
ACF (autocorrelation) dominant period
This compresses distances for bars that are one or more full cycles apart, improving smoothing without lagging trends.
Adaptive scales: Price/volume bandwidths use Robust MAD, Stdev, or ATR. Optional Super Smoother center reduces noise before measuring distances.
Visual regime coloring: Short above Long → teal (bullish). Short below Long → orange (bearish). Optional fill highlights the spread.
How to read it
Trend filter: Trade in the direction of the color (teal bullish, orange bearish).
Crossovers: Short crossing above Long often marks early trend continuation after pullbacks; crossing below can warn of weakening momentum.
Spread width: A widening gap suggests strengthening trend; a shrinking gap hints at consolidation or a possible regime change.
Key settings
Lengths
Short/Long window: Lookback for each radial MA. Short reacts faster; Long stabilizes the regime.
Kernel & Metric
Kernel: Gaussian, Laplacian, or Cauchy (default). Cauchy is heavier-tailed (keeps more outliers), Gaussian is tighter.
Axis weights (αₜ, αₚ, αᵥ): Importance of time/price/volume distances. Increase a weight to make that axis matter more.
Ignore weights below: Hard cutoff for tiny kernel weights to speed up/clean contributions.
Time Folding
Topology: Linear (standard MA behavior) or Circular (Homodyne/ACF) (cycle-aware).
Cycle floor/ceil: Bounds for the dominant period search.
σₜ mode: Auto sets time bandwidth from the detected period (or length in Linear mode) × multiplier; Manual fixes σₜ in bars.
Price/Volume Scaling
Price scale: Robust MAD (outlier-resistant), Stdev, or ATR (trend-aware).
σₚ/σᵥ multipliers: Bandwidths for price/volume axes. Larger values = looser matching (smoother, more lag).
Use log(volume): Stabilizes volume’s scale across regimes; recommended.
Kernel Center
Price center: Raw (close) or Super Smoother to reduce noise before measuring price distance.
Plotting
Plot source: Show/hide the input source.
Fill between lines: Visual emphasis of the short/long spread.
Tips
Start with defaults: Cauchy, Circular (Homodyne), Robust MAD, log-volume on.
For choppy/cyclical symbols, Circular time folding often reduces false flips.
If signals feel too twitchy, either increase Short/Long lengths or raise σₚ/σᵥ multipliers (looser kernel).
For strong trends with regime shifts, try ATR price scaling.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Script protegido
Esse script é publicada como código fechado. No entanto, você pode usar ele livremente e sem nenhuma limitação – saiba mais aqui.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.