Library "aprox"
It's a library of the aproximations of a price or Series float it uses Fourier transform and
Euler's Theoreum for Homogenus White noice operations. Calling functions without source value it automatically take close as the default source value.

Copy this indicator to see how each approximations interact between each other.
import Celje_2300/aprox/1 as aprox

//@version=5
indicator("Close Price with Aproximations", shorttitle="Close and Aproximations", overlay=false)

// Sample input data (replace this with your own data)
inputData = close

// Plot Close Price
plot(inputData, color=color.blue, title="Close Price")


dtf32_result = aprox.DTF32()
plot(dtf32_result, color=color.green, title="DTF32 Aproximation")

fft_result = aprox.FFT()
plot(fft_result, color=color.red, title="DTF32 Aproximation")

wavelet_result = aprox.Wavelet()
plot(wavelet_result, color=color.orange, title="Wavelet Aproximation")

wavelet_std_result = aprox.Wavelet_std()
plot(wavelet_std_result, color=color.yellow, title="Wavelet_std Aproximation")





DFT3(xval, _dir)
  Parameters:
    xval (float)
    _dir (int)

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - DFT3", shorttitle="DFT3 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply DFT3
result = aprox.DFT3(inputData, 2)

// Plot the result
plot(result, color=color.blue, title="DFT3 Result")

DFT2(xval, _dir)
  Parameters:
    xval (float)
    _dir (int)
//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - DFT2", shorttitle="DFT2 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply DFT2
result = aprox.DFT2(inputData, inputData, 1)

// Plot the result
plot(result, color=color.green, title="DFT2 Result")
//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - DFT2", shorttitle="DFT2 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply DFT2
result = aprox.DFT2(inputData, 1)

// Plot the result
plot(result, color=color.green, title="DFT2 Result")

FFT(xval)
  FFT: Fast Fourier Transform
  Parameters:
    xval (float)
  Returns: Aproxiated source value

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - FFT", shorttitle="FFT Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply FFT
result = aprox.FFT(inputData)

// Plot the result
plot(result, color=color.red, title="FFT Result")

DTF32(xval)
  DTF32: Combined Discrete Fourier Transforms
  Parameters:
    xval (float)
  Returns: Aproxiated source value

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - DTF32", shorttitle="DTF32 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply DTF32
result = aprox.DTF32(inputData)

// Plot the result
plot(result, color=color.purple, title="DTF32 Result")

whitenoise(indic_, _devided, minEmaLength, maxEmaLength, src)
  whitenoise: Ehler's Universal Oscillator with White Noise, without extra aproximated src
  Parameters:
    indic_ (float)
    _devided (int)
    minEmaLength (int)
    maxEmaLength (int)
    src (float)
  Returns: Smoothed indicator value

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - whitenoise", shorttitle="whitenoise Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply whitenoise
result = aprox.whitenoise(aprox.FFT(inputData))

// Plot the result
plot(result, color=color.orange, title="whitenoise Result")

whitenoise(indic_, dft1, _devided, minEmaLength, maxEmaLength, src)
  whitenoise: Ehler's Universal Oscillator with White Noise and DFT1
  Parameters:
    indic_ (float)
    dft1 (float)
    _devided (int)
    minEmaLength (int)
    maxEmaLength (int)
    src (float)
  Returns: Smoothed indicator value

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - whitenoise with DFT1", shorttitle="whitenoise-DFT1 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply whitenoise with DFT1
result = aprox.whitenoise(inputData, aprox.DFT1(inputData))

// Plot the result
plot(result, color=color.yellow, title="whitenoise-DFT1 Result")

smooth(dft1, indic__, _devided, minEmaLength, maxEmaLength, src)
  smooth: Smoothing source value with help of indicator series and aproximated source value
  Parameters:
    dft1 (float)
    indic__ (float)
    _devided (int)
    minEmaLength (int)
    maxEmaLength (int)
    src (float)
  Returns: Smoothed source series

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - smooth", shorttitle="smooth Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply smooth
result = aprox.smooth(inputData, aprox.FFT(inputData))

// Plot the result
plot(result, color=color.gray, title="smooth Result")

smooth(indic__, _devided, minEmaLength, maxEmaLength, src)
  smooth: Smoothing source value with help of indicator series
  Parameters:
    indic__ (float)
    _devided (int)
    minEmaLength (int)
    maxEmaLength (int)
    src (float)
  Returns: Smoothed source series

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - smooth without DFT1", shorttitle="smooth-NoDFT1 Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply smooth without DFT1
result = aprox.smooth(aprox.FFT(inputData))

// Plot the result
plot(result, color=color.teal, title="smooth-NoDFT1 Result")

vzo_ema(src, len)
  vzo_ema: Volume Zone Oscillator with EMA smoothing
  Parameters:
    src (float)
    len (simple int)
  Returns: VZO value

vzo_sma(src, len)
  vzo_sma: Volume Zone Oscillator with SMA smoothing
  Parameters:
    src (float)
    len (int)
  Returns: VZO value

vzo_wma(src, len)
  vzo_wma: Volume Zone Oscillator with WMA smoothing
  Parameters:
    src (float)
    len (int)
  Returns: VZO value

alma2(series, windowsize, offset, sigma)
  alma2: Arnaud Legoux Moving Average 2 accepts sigma as series float
  Parameters:
    series (float)
    windowsize (int)
    offset (float)
    sigma (float)
  Returns: ALMA value

Wavelet(src, len, offset, sigma)
  Wavelet: Wavelet Transform
  Parameters:
    src (float)
    len (int)
    offset (simple float)
    sigma (simple float)
  Returns: Wavelet-transformed series

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - Wavelet", shorttitle="Wavelet Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply Wavelet
result = aprox.Wavelet(inputData)

// Plot the result
plot(result, color=color.blue, title="Wavelet Result")

Wavelet_std(src, len, offset, mag)
  Wavelet_std: Wavelet Transform with Standard Deviation
  Parameters:
    src (float)
    len (int)
    offset (float)
    mag (int)
  Returns: Wavelet-transformed series

//@version=5
import Celje_2300/aprox/1 as aprox

indicator("Example - Wavelet_std", shorttitle="Wavelet_std Example", overlay=true)

// Sample input data (replace this with your own data)
inputData = close

// Apply Wavelet_std
result = aprox.Wavelet_std(inputData)

// Plot the result
plot(result, color=color.green, title="Wavelet_std Result")
Versionsinformation:
v2

Added:
DFT32(xval)
  DFT32 Combined Discrete Fourier Transforms of DFT3 and DTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
  Parameters:
    xval (float): Array of input values
  Returns: Aproxiated source value

Updated:
DFT3(xval, _dir)
  DFT3 Discrete Fourier Transform with last 3 points
  Parameters:
    xval (float)
    _dir (int): Direction parameter
  Returns: Aproxiated source value

DFT2(xval, _dir)
  DFT2 Discrete Fourier Transform with last 2 points
  Parameters:
    xval (float)
    _dir (int): Direction parameter
  Returns: Aproxiated source value

FFT(xval)
  FFT Fast Fourier Transform once. It aproximates usig last 3 points.
  Parameters:
    xval (float): Array of input values
  Returns: Aproxiated source value

whitenoise(indic_, dft1, _devided, minEmaLength, maxEmaLength, src)
  whitenoise Ehler's Universal Oscillator with White Noise and DFT1.
It uses src and sproxiated src (dft1) to clearly define white noice.
It uses dinamic EMA to aproximate indicator and thus reducing noise.
  Parameters:
    indic_ (float): Input series for the indicator values to be smoothed
    dft1 (float): Aproximated src value for white noice calculation
    _devided (int): Divisor for oscillator calculations
    minEmaLength (int): Minimum EMA length
    maxEmaLength (int): Maximum EMA length
    src (float): Source series
  Returns: Smoothed indicator value

smooth(indic__, _devided, minEmaLength, maxEmaLength, src)
  smooth Smoothing source value with help of indicator series
It uses dinamic EMA to aproximate src and thus reducing noise.
  Parameters:
    indic__ (float): Optional input for indicator to help smooth dft1 (default is FFT)
    _devided (int): Divisor for smoothing calculations
    minEmaLength (int): Minimum EMA length
    maxEmaLength (int): Maximum EMA length
    src (float): Source series
  Returns: Smoothed src series

vzo_ema(src, len)
  vzo_ema Volume Zone Oscillator with EMA smoothing
  Parameters:
    src (float): Source series
    len (simple int): Length parameter for EMA
  Returns: VZO value

vzo_sma(src, len)
  vzo_sma Volume Zone Oscillator with SMA smoothing
  Parameters:
    src (float): Source series
    len (int): Length parameter for SMA
  Returns: VZO value

vzo_wma(src, len)
  vzo_wma Volume Zone Oscillator with WMA smoothing
  Parameters:
    src (float): Source series
    len (int): Length parameter for WMA
  Returns: VZO value

alma2(series, windowsize, offset, sigma)
  alma2 Arnaud Legoux Moving Average 2 accepts sigma as series float
  Parameters:
    series (float): Input series
    windowsize (int): Size of the moving average window
    offset (float): Offset parameter
    sigma (float): Sigma parameter
  Returns: ALMA value

Wavelet(src, len, offset, sigma)
  Wavelet Wavelet Transform
  Parameters:
    src (float): Source series
    len (int): Length parameter for ALMA
    offset (simple float)
    sigma (simple float)
  Returns: Wavelet-transformed series

Wavelet_std(src, len, offset, mag)
  Wavelet_std Wavelet Transform with Standard Deviation
  Parameters:
    src (float): Source series
    len (int): Length parameter for ALMA
    offset (float): Offset parameter for ALMA
    mag (int): Magnitude parameter for standard deviation
  Returns: Wavelet-transformed series

Removed:
DTF32(xval)
  DTF32: Combined Discrete Fourier Transforms
Versionsinformation:
v3

Added:
DTF32(xval)
  DFT32: Combined Discrete Fourier Transforms of DFT3 and DTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
  Parameters:
    xval (float): Array of input values
  Returns: Aproxiated source value

Updated:
DFT3(xval, _dir)
  DFT3: Discrete Fourier Transform with last 3 points
  Parameters:
    xval (float)
    _dir (int): Direction parameter
  Returns: Aproxiated source value

DFT2(xval, _dir)
  DFT2: Discrete Fourier Transform with last 2 points
  Parameters:
    xval (float)
    _dir (int): Direction parameter
  Returns: Aproxiated source value

FFT(xval)
  FFT: Fast Fourier Transform once. It aproximates usig last 3 points.
  Parameters:
    xval (float): Array of input values
  Returns: Aproxiated source value

DFT32(xval)
  DFT32: Combined Discrete Fourier Transforms of DFT3 and DTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
  Parameters:
    xval (float): Array of input values
  Returns: Aproxiated source value

whitenoise(indic_, dft1, _devided, minEmaLength, maxEmaLength, src)
  whitenoise: Ehler's Universal Oscillator with White Noise and DFT1.
It uses src and sproxiated src (dft1) to clearly define white noice.
It uses dinamic EMA to aproximate indicator and thus reducing noise.
  Parameters:
    indic_ (float): Input series for the indicator values to be smoothed
    dft1 (float): Aproximated src value for white noice calculation
    _devided (int): Divisor for oscillator calculations
    minEmaLength (int): Minimum EMA length
    maxEmaLength (int): Maximum EMA length
    src (float): Source series
  Returns: Smoothed indicator value

smooth(indic__, _devided, minEmaLength, maxEmaLength, src)
  smooth: Smoothing source value with help of indicator series
It uses dinamic EMA to aproximate src and thus reducing noise.
  Parameters:
    indic__ (float): Optional input for indicator to help smooth dft1 (default is FFT)
    _devided (int): Divisor for smoothing calculations
    minEmaLength (int): Minimum EMA length
    maxEmaLength (int): Maximum EMA length
    src (float): Source series
  Returns: Smoothed src series

vzo_ema(src, len)
  vzo_ema: Volume Zone Oscillator with EMA smoothing
  Parameters:
    src (float): Source series
    len (simple int): Length parameter for EMA
  Returns: VZO value

vzo_wma(src, len)
  vzo_wma: Volume Zone Oscillator with WMA smoothing
  Parameters:
    src (float): Source series
    len (int): Length parameter for WMA
  Returns: VZO value

alma2(series, windowsize, offset, sigma)
  alma2: Arnaud Legoux Moving Average 2 accepts sigma as series float
  Parameters:
    series (float): Input series
    windowsize (int): Size of the moving average window
    offset (float): Offset parameter
    sigma (float): Sigma parameter
  Returns: ALMA value

Wavelet(src, len, offset, sigma)
  Wavelet Wavelet Transform: aproxiates srt using Discrete wavelet transform.
  Parameters:
    src (float): Source series
    len (int): Length parameter for ALMA
    offset (simple float)
    sigma (simple float)
  Returns: Wavelet-transformed series

Wavelet_std(src, len, offset, mag)
  Wavelet_std: aproxiates srt using Discrete wavelet transform with standard deviation as a magnitude.
  Parameters:
    src (float): Source series
    len (int): Length parameter for ALMA
    offset (float): Offset parameter for ALMA
    mag (int): Magnitude parameter for standard deviation
  Returns: Wavelet-transformed series

Pinebibliotek

I sann TradingView-anda har författaren publicerat denna Pine-kod som ett bibliotek med öppen källkod så att andra Pine-programmerare från vår community kan återanvända den. Hatten av för författaren! Du kan använda det här biblioteket privat eller i andra publikationer med öppen källkod, men återanvändning av den här koden i en publikation regleras av våra ordningsregler.

Frånsägelse av ansvar

Informationen och publikationerna är inte avsedda att vara, och utgör inte heller finansiella, investerings-, handels- eller andra typer av råd eller rekommendationer som tillhandahålls eller stöds av TradingView. Läs mer i Användarvillkoren.

Vill du använda det här biblioteket?

Kopiera följande rad och klistra in det i ditt skript.