OPEN-SOURCE SCRIPT

Multi-Timeframe Trend Cloud (EMA13/21) with Alerts

업데이트됨
Purpose:

This indicator combines trend analysis across multiple timeframes with alerts to help identify general trends and market shifts. It visualizes trends by creating EMA clouds (The area between EMA13 & EMA21), detects confirmed EMA crossovers, and can alert users when the price re-enters the cloud or interacts with the EMA200.

Input Parameters:

  • Lower Timeframe (LTF): Allows you to select the lower timeframe for trend analysis (e.g., 1 hour, 4 hours).
  • Higher Timeframe (HTF): Allows you to select the higher timeframe for the main trend reference (e.g., 4 hours, 1 day).
  • Fill Colors: You can customize the colors used to fill the areas between the EMA lines in both the higher and lower timeframes. Note: The LTF cloud defaults to transparent white so if you have a light background change the color in style settings.
  • The EMA's default to transparent but can be turned on in the style settings.


Calculating & Plotting EMAs:

  • The indicator calculates two Exponential Moving Averages (EMAs) on both the LTF and HTF: a faster 13-period EMA and a slower 21-period EMA.
  • Additionally, it calculates a 200-period EMA on the HTF.
  • These EMAs are plotted on your chart, providing a visual representation of the trend.


Identifying Trend States:

The script uses the relationships between the price and the 13-period and 21-period EMAs on the Higher Time Frame (HTF) to identify four distinct trend states, each depicted by a specific color to create the "Trend Cloud":

  • Strong Bull Trend: The 13-period EMA is above the 21-period EMA, and the price is above both EMAs. --- "Color 0" in HTF Trend style settings.
  • Broken Bullish Trend: The 13-period EMA is above the 21-period EMA but price has broken below both EMA's. --- "Color 3" in HTF Trend style settings.
  • Strong Bear Trend: The 13-period EMA is below the 21-period EMA, and the price is below both EMAs. --- "Color 2" in HTF Trend style settings.
  • Broken Bearish Trend: The 13-period EMA is below the 21-period EMA but price has broken above both EMA's. --- "Color 1" in HTF Trend style settings.
  • Important Note: The 200-period EMA is plotted for reference but is not directly used in determining the current trend state within this script.


Confirmed Crossover Signals:

The indicator plots upward or downward triangles to signal confirmed crossovers of the EMA13 and EMA21 on the HTF. A crossover is considered "confirmed" when it's followed by a candle closing on the same side of the crossing point, adding an extra layer of confidence to the signal.

Cloud Re-entry Alerts:

Receive alerts whenever the price re-enters the HTF cloud - aka "Trend".

EMA200 Retest Alerts:

Get alerts when the price touches the 200 EMA on the HTF. These alerts can be valuable for identifying potential trend reversals or trend continuation scenarios.

Benefits:

  • Clear Visual Representation: Easily visualize trends on both the lower and higher timeframes.
  • Confirmed Signals: Filter out false signals by focusing on confirmed crossovers.
  • Timely Alerts: Get instant notifications for important price actions, allowing you to react quickly to market opportunities.
  • Customizable: Tailor the indicator's appearance and alert settings to your preferences.


How to Use:

  1. Add the indicator to your chart.
  2. Select your desired LTF and HTF in the Inputs tab.
  3. Customize the fill colors (and optional EMA line colors) in the Style tab.
  4. Enable the alerts you want to receive in the Alerts tab.


Note: This indicator is a great tool for trend analysis, but it should be used with other forms of analysis and risk management techniques to make informed trading decisions.
릴리즈 노트
Mini Update: Added input option to choose EMA21 or EMA25 for the Long EMA of the trend cloud.
Moving AveragesmultitimeframeTrend Analysis

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항