mickes

Moving average to price cloud

Hi all!

This indicator shows when the price crosses the defined moving average. It plots a green or red cloud (depending on trend) and the moving average. It also plots an arrow when the trend changes (this can be disabled in 'style'->'labels' in the settings).

The moving average itself can be used as dynamic support/resistance. The trend will change based on your settings (described below). By default the trend will change when the whole bar is above/below the moving average for 2 bars (that's closed). This can be changed by "Source" and "Bars".

Settings
• Length (choose the length of the moving average. Defaults to 21)

• Type (choose what type of moving average).
- "SMA" (Simple Moving Average)
- "EMA" (Exponential Moving Average)
- "HMA" (Hull Moving Average)
- "WMA" (Weighted Moving Average)
- "VWMA" (Volume Weighted Moving Average)
- "DEMA" (Double Exponential Moving Average)

Defaults to"EMA".

• Source (Define the price source that must be above/below the moving average for the trend to change. Defaults to 'High/low (passive)')

- 'Open' The open of the bar has to cross the moving average
- 'Close' The close of the bar has to cross the moving average
- 'High/low (passive)' In a down trend: the low of the bar has to cross the moving average
- 'High/low (aggressive)' In a down trend: the high of the bar has to cross the moving average

• Source bar must be close. Defaults to 'true'.

• Bars (Define the number bars whose value (defined in 'Source') must be above/below the moving average. All the bars (defined by this number) must be above/below the moving average for the trend to change. Defaults to 2.)

Let me know if you have any questions.

Best of trading luck!
Script de código abierto

Siguiendo el verdadero espíritu de TradingView, el autor de este script lo ha publicado en código abierto, para que los traders puedan entenderlo y verificarlo. ¡Un hurra por el autor! Puede utilizarlo de forma gratuita, aunque si vuelve a utilizar este código en una publicación, debe cumplir con lo establecido en las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.

¿Quiere utilizar este script en un gráfico?