OPEN-SOURCE SCRIPT
Mis à jour Compound SMAs

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.
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.
Notes de version
Updated ChartScript open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.