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. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟