lastguru

CommonFilters

lastguru Telah dikemas kini   
Library "CommonFilters"
Collection of some common Filters and Moving Averages. This collection is not encyclopaedic, but to declutter my other scripts. Suggestions are welcome, though. Many filters here are based on the work of John F. Ehlers

sma(src, len) Simple Moving Average
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

ema(src, len) Exponential Moving Average
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

rma(src, len) Wilder's Smoothing (Running Moving Average)
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

hma(src, len) Hull Moving Average
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

vwma(src, len) Volume Weighted Moving Average
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

hp2(src) Simple denoiser
  Parameters:
    src: Series to use
  Returns: Filtered series

fir2(src) Zero at 2 bar cycle period by John F. Ehlers
  Parameters:
    src: Series to use
  Returns: Filtered series

fir3(src) Zero at 3 bar cycle period by John F. Ehlers
  Parameters:
    src: Series to use
  Returns: Filtered series

fir23(src) Zero at 2 bar and 3 bar cycle periods by John F. Ehlers
  Parameters:
    src: Series to use
  Returns: Filtered series

fir234(src) Zero at 2, 3 and 4 bar cycle periods by John F. Ehlers
  Parameters:
    src: Series to use
  Returns: Filtered series

hp(src, len) High Pass Filter for cyclic components shorter than langth. Part of Roofing Filter by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

supers2(src, len) 2-pole Super Smoother by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

filt11(src, len) Filt11 is a variant of 2-pole Super Smoother with error averaging for zero-lag response by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

supers3(src, len) 3-pole Super Smoother by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

hannFIR(src, len) Hann Window Filter by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

hammingFIR(src, len) Hamming Window Filter (inspired by John F. Ehlers). Simplified implementation as Pedestal input parameter cannot be supplied, so I calculate it from the supplied length
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

triangleFIR(src, len) Triangle Window Filter by John F. Ehlers
  Parameters:
    src: Series to use
    len: Filtering length
  Returns: Filtered series

doPrefilter(type, src) Execute a particular Prefilter from the list
  Parameters:
    type: Prefilter type to use
    src: Series to use
  Returns: Filtered series

doMA(type, src, len) Execute a particular MA from the list
  Parameters:
    type: MA type to use
    src: Series to use
    len: Filtering length
  Returns: Filtered series
Nota Keluaran:
v2 Added Jurik MA (JMA):
jma(src, len, phase) Jurik MA
  Parameters:
    src: Series to use
    len: Filtering length
    phase: JMA Phase
  Returns: Filtered series
Based on the reverse-engineered JMA documented by somebody called Igor: c.mql5.com/forextsd/...orum/164/jurik_1.pdf
Inspired by @everget implementation: Inspired by @gorx1 implementation: As JMA is a proprietary closed-source algorithm, every JMA implementation I've seen is based on the Igor's document
Many of the implementations, however, are not true to the source
As far as I know, this is the first correct JMA implementation on TradingView
As the Igor's document itself is incomplete, however, there is some grey area still...

Tips in TradingView Coins are appreciated
Perpustakaan Pine

Di dalam semangat sebenar TradingView, pengarang telah menerbitkan kod Pine ini sebagai perpustakaan sumber terbuka, jadi pengaturcara-pengaturcara Pine yang lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau pada penerbitan-penerbitan sumber terbuka lain, tetapi penggunaan semula kod ini di dalam penerbitan adalah ditadbir oleh Peraturan Dalaman.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Mahu gunakan perpustakaan ini?

Salin garisan ini dan tampalkan ia di dalam skrip anda.