PineCodersTASC

TASC 2023.04 Undersampled Double MA

█ OVERVIEW

TASC's April 2023 edition of Traders' Tips features an article entitled "Just Ignore Them: Undersampling The Data As A Smoothing Technique" by John ​Ehlers, which explores a method for reducing noise through data sampling. This script implements the article's proposed Undersampled Double MA indicator.

█ CONCEPTS

The conventional approach to reducing the impact of noise in the market data on trading rules is to use smoothing filters like moving averages. However, John ​Ehlers suggests that changing the sample rate of the datastream is a simple and effective way to smooth the data and reduce noise. Specifically, he argues that undersampling the data removes high-frequency components contributing to noisiness. Notably, the elimination of these components produces less lag than that of conventional smoothing filters.

The Undersampled Double MA indicator implemented in this script represents a practical application of smoothing with undersampling. It samples the data at a given rate (for instance, once every five bars, as suggested by ​Ehlers), then processes the resulting data using a Hann window filter with two different periods, producing two smooth data streams that traders can use in the same way as the combination of two conventional moving averages of different lengths (i.e., fast and slow MAs).

█ CALCULATIONS

The script samples data once every Nth bar (by default, N = 5) and smooths the undersampled data with 6-period and 12-period Hann filters, which it plots on the main chart. Users can adjust the sampling period and the periods of each Hann filter to their liking from the inputs in the script settings.

Tools and ideas for all Pine coders: www.tradingview.com/u/PineCoders/
Pine news broadcasts: t.me/PineCodersSquawkBox or twitter.com/PineCoders
TASC: traders.com/
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

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.

Ingin menggunakan skrip ini pada carta?