OPEN-SOURCE SCRIPT
Telah dikemas kini

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.
Nota Keluaran
Updated Chart

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.