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!
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?