Two Pole Butterworth Filter

The Two Pole Butterworth Filter (TPBF) was authored by John Ehlers. The TPBF uses current price, previous prices and feedback in its calculation. The user may change the input (close) and period length. This indicator’s definition is further expressed in the condensed code given in the calculation below.

Two Pole Butterworth Filter

How To Trade Using Two Pole Butterworth Filter

The Two Pole Butterworth Filter is a trend indicator and may be used in conjunction with other studies. No trading signals are calculated.

How To Access in MotiveWave

Go to the top menu, choose Study>John Ehlers>Two Pole Butterworth Filter

or go to the top menu, choose Add Study, start typing in this study name until you see it appear in the list, click on the study name, click OK.

Important Disclaimer: The information provided on this page is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security. Please see our Risk Disclosure and Performance Disclaimer Statement.


//input = price, user defined, default is closing price
//period = user defined, default is 20
//prev = previous, index = current bar number

prevP1 = price[index-1];
prevP2 = price[index-2];
prevB1 = ifNull(price, butter[index-1]);  //feedback ingredent
prevB2 = ifNull(price, butter[index-2]);  //feedback ingredent
piPrd = Math.PI/period;
a1 = Math.exp(-1.414 * piPrd);
b1 = 2 * a1 * Math.cos(1.414 * piPrd);
coef2 = b1;
coef3 = -a1 * a1;
coef1 = (1 - b1 + a1 * a1) / 4;
plot: butter = coef1 * (price + (2*prevP1) + prevP2) + (coef2*prevB1) + (coef3*prevB2);