John F. Ehlers proposes to a new solution to “Remove a Moving Average Lag” in the March 2025 issue of Trader’s Tips.
He explains that the average price in a time series average represents a statistical estimate for a block of price values, where the estimate is positioned at the block’s centre on the time axis. In the case of a simple moving average (SMA), the calculation moves the analysed block along the time axis and computes an average after each new price point. Because the average’s position is at the centre of each block, the SMA, by definition, lags behind price changes by half the data length.
To remove/mitigate this lag, Ehlers proposes a new projected moving average (PMA). He does this by adding half the data length of a block to the simple moving average using the data’s linear regression slope.
This is easy to implement in ProRealtime:
1 2 3 4 5 6 7 8 9 10 |
// length = 10 // slope = LinearRegressionSlope[ length ]( close ) projection = slope * length / 2 sma = average[ length ]( close ) pma = sma + projection return pma, sma |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials