Wilder Smoothed Moving Average Crossovers for Trend Direction
Summary
This short script uses Wilder-style smoothed moving averages of closing price to generate directional signals. With the displayed defaults, it compares a faster average using a 20-bar length against a slower average using a 55-bar length. A crossover of the faster average above the slower one opens a long position; a crossunder opens a short position. The accompanying description frames the method as a trend tool for weekly-bar analysis, with daily bars used for hedging, but the code itself contains no separate hedge logic or exit rules beyond reversing direction when the opposite crossover occurs.
Despite the title’s reference to MACD, the implementation is a two-average crossover and does not calculate a MACD line or signal line. The document supplies no market, backtest period, performance statistics, or risk controls, so it provides a basic rule example rather than evidence of trading results. Crossovers can lag turning points and may produce repeated reversals in sideways markets; the script does not discuss these limitations or assess costs and execution.
Key ideas
- The script compares faster and slower Wilder-smoothed averages of closing price to set directional bias.
- Crosses between the averages trigger long or short entries, with no distinct stop or profit-taking rule shown.
- The displayed default lookbacks are 20 bars and 55 bars, with a 10-bar signal length input that is unused.
- Although the title mentions MACD, the code implements a moving-average crossover instead.
- No backtest evidence, risk controls, or transaction-cost assumptions are provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.