Multiple Pass Moving Average

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Multiple Pass Moving Average

Postby Apprentice » Mon Dec 09, 2024 2:56 pm

EURUSD D1 (12-09-2024 2049).png

A multiple pass simple moving average filter is a SMA filter which has been applied multiple times to the same signal.

Two passes through a simple moving average filter produces the same effect as a triangular moving average filter (convolution of a square wave with a square wave is a triangle wave).

After four or more passes, it is equivalent to a Gaussian filter.
Multiple Pass Moving Average.lua
(7.38 KiB) Downloaded 143 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38111
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Multiple Pass Moving Average

Postby Apprentice » Mon Dec 09, 2024 3:32 pm

EURUSD D1 (12-09-2024 2128).png

This is a variant of the MPMA that shifts the final output by N/2 periods to the left.
This shift centers the moving average on the price data, reducing the lag introduced by traditional moving averages.
It provides a more accurate representation of the current trend by aligning the moving average closer to the price action.

Advantages:
Provides a more accurate trend representation by reducing lag.
Ideal for detecting reversals and current trend changes more promptly.
Useful in strategies where timing is critical, such as breakout trading or counter-trend strategies.
Multiple Pass Moving Average (MPMA) with Shift.lua
(8.83 KiB) Downloaded 137 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38111
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Multiple Pass Moving Average

Postby Ariel19 » Mon Dec 23, 2024 2:35 am

Apprentice wrote:
EURUSD D1 (12-09-2024 2128).png

This is a variant of the MPMA that shifts the final output by N/2 periods to the left.
This shift centers the moving average on the price data, reducing the lag introduced by traditional moving averages.
It provides a more accurate representation of the current trend by aligning the moving average closer to the price action.
agario
Advantages:
Provides a more accurate trend representation by reducing lag.
Ideal for detecting reversals and current trend changes more promptly.
Useful in strategies where timing is critical, such as breakout trading or counter-trend strategies.
Multiple Pass Moving Average (MPMA) with Shift.lua

How does the shift of N/2 periods in the MPMA variant improve the accuracy of trend representation compared to traditional moving averages?
Ariel19
 
Posts: 2
Joined: Mon Dec 16, 2024 10:02 pm

Re: Multiple Pass Moving Average

Postby Apprentice » Mon Dec 30, 2024 8:02 pm

The shift of N/2 periods in the Median Price Moving Average (MPMA) variant improves the accuracy of trend representation compared to traditional moving averages by addressing the lag inherent in most moving averages. Here's how it works:

Traditional Moving Averages and Lag

Lag Issue: Traditional moving averages, like the Simple Moving Average (SMA) or Exponential Moving Average (EMA), inherently lag behind the actual price movement because they rely on averaging past data points. The larger the period N, the greater the lag.
Lag Impact: This lag can delay signals for trend reversals or continuations, making the moving average less effective for responsive trend representation.
Shift of N/2 in MPMA

Centering the Moving Average: The N/2 shift aligns the moving average with the median of the data window rather than trailing the current price. This adjustment reduces the visual and analytical lag by effectively repositioning the moving average to reflect the middle of the trend period.
Improved Accuracy: By centering the moving average, it becomes more synchronous with price action, offering a more realistic representation of the underlying trend.
Enhanced Responsiveness: The centered average reduces the delay in detecting changes in trend direction, making it more useful for identifying turning points.
Why MPMA Specifically?

Median Price Basis: MPMA uses the median price ((High + Low) / 2) instead of closing prices, providing a smoother and more representative measure of price action within a period.
Trend Fidelity: Combining the median price with the centered average improves the indicator's ability to represent price trends more accurately, as it avoids some of the noise associated with extreme high or low values.
Practical Impact

Early Signals: The reduced lag allows for earlier identification of potential trend changes.
Better Decision-Making: Traders and analysts can make more informed decisions, as the centered average provides a clearer and more immediate view of the current trend.
Summary In summary, the N/2 shift in the MPMA significantly enhances the utility of the moving average for trend analysis by reducing lag and aligning the indicator more closely with actual market dynamics. This adjustment improves both the timeliness and accuracy of trend representation compared to traditional moving averages.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 38111
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Multiple Pass Moving Average

Postby mocodeh613 » Thu Jan 02, 2025 2:13 am

Apprentice wrote:
EURUSD D1 (12-09-2024 2049).png

A multiple pass simple moving average filter is a SMA filter which has been applied multiple times to the same signal.

Two passes through a simple moving average filter produces the same effect as a triangular moving average filter (convolution of a square wave with a square wave is a triangle wave).
duck life
After four or more passes, it is equivalent to a Gaussian filter.
Multiple Pass Moving Average.lua

Indeed, applying a simple moving average filter multiple times increasingly approximates a Gaussian filter due to the Central Limit Theorem, smoothing the signal more effectively with each pass.
mocodeh613
 
Posts: 1
Joined: Thu Jan 02, 2025 2:06 am


Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 3 guests