OPEN-SOURCE SCRIPT
已更新

Compound SMAs

295
This script calculates all the moving averages from a range of lengths (from X to Y), and plots the lowest (or highest) average for each. This gives an interesting effect where the MA line gives space to the price when rising (or falling) and tightens up when price is falling (or rising). This may be useful for getting into a position earlier and riding a trend longer. It may also be useful for decreasing whipsaw exits in trending markets.

It has a technical limitation, due to how many calculations the for loop has to do, i have included a limit input for the number of bars back to use in each MA. It is set to 3000 arbitrarily just to avoid sluggishness or potential crashes.

To use, identify the long term trend and choose "Bullish" or "Bearish". Input the source and range of MAs you would like included, and how many bars to use in the calculation. Optionally you may add a smoothing factor as well at the cost of additional lag.
版本注释
Updated Chart

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。