OPEN-SOURCE SCRIPT

MTF - Zigzag + Tech Indicators

Güncellendi
MTF - Zigzag + Tech Indicators

At high level the indicator can be a useful tool while analyzing the charts. It marks swing points (Zigzag) on 3 different timeframes along with capability to view key technical indicator values at each of the swing point.

Normally Zaizag indicators are useful for identifying primary trend and retracements. Zigzags also help in identifying key support and resistance areas. Traders develop various trading strategies based on Zigzags.

Most of the published Zigzag indicators use single timeframe / chart timeframe to draw the Zigzag lines but, many traders/chart analysts would like to analyze trends on multiple timeframes. Single timeframe Zigzags makes such analysis little difficult.

This indicator is an advanced version of Zigzag which allow users to draw Zigzag lines on multiple timeframes. It allows users to input 2 additional higher timeframes and in total it draws Zigzag on 3 timeframes i.e., on chart timeframe and 2 additional higher timeframes.

Once loaded on the chart, it draws Zigzag lines and plot labels (HH, LL, HL, LH) which denotes swing points. Each of the swing point label has a tooltip attached to it, which provide few additional data point, to view the additional data points, hover the mouse over the label.

Swing label tooltip shows these additional data points:

  • Tag: Swing type (HH, LL, HL, LH) + Bar time (in dd-mm-yyyy hh:mm format)
  • Price point: Swing price point
  • Price change: Price change since previous swing point along with change %
  • Swing volume: Volume since previous swing point in million
  • Key technical indicator values:
  • RSI (close, 14)
  • Stochastic (close, high, low, 14)
  • ADX (14, 14)
  • SMA20
  • SMA50
  • SMA100
  • SMA200


Use cases:
  • Support resistance: Though most of the swing points of a zigzag are treated as a support or resistance. This indicator allows to add more depth to the analysis. E.g., swing points based on lowest timeframe (chart timeframe) can be treated as weak support/resistance whereas swing points based on higher timeframe can treated as strong support/resistance and prices need to hit it multiple time to cross/break the same.
  • Trend identification: Trend on lowest timeframe (chart timeframe) can be a immediate term trend, trend on the mid-level higher timeframe can be a short term trend and trend on the highest level timeframe can be a long term trend.
  • Trade identification, entry, and exit: MTF Zigzag can also be creatively used while trading. Eg. One can identify a trend on highest level timeframe and use mid-level timeframe for trade entry and lowest level timeframe can be used for Take Profit levels (TP1, TP2, ..) and Stop loss. Alternatively, Trend can be identified on highest or mid-level timeframe and trade entry/exit can be based on lowest level timeframe.
  • Use of information displayed in tooltip: Analysts/traders look for confirmations from other indicators while initiating trades. These additional indicator values become handy/readily available source of information without specifically navigating through different indicators/charts. These indicator values can be creatively used in many ways. Some of the examples are:

  1. Easy comparison of values of moving averages on all 3 timeframes
  2. Better assessment of momentum and overbought/oversold based on value of stochastic and rsi
  3. Use of ADX to determine the strength of the trend
  4. Trade decision based on increasing or decreasing order of moving averages
  5. Trade decision, based order of moving averages combined with overbought/oversold and strength of the trend



Chart examples: TCS on 60m/4h/1D
https://www.tradingview.com/x/sQ9wABcK


ITC 4h/1D
https://www.tradingview.com/x/sQ9wABcK


Input Parameters:
1. Chart timeframe zigzag setup: to plot zigzag based on chart timeframe
2. Higher timeframe zigzag setup: to plot zigzag based on higher timeframe
3. Higher timeframe zigzag setup 1: to plot zigzag based on another higher timeframe

Each of these have user selectable options:
1. Color/width of the zigzag line
2. plot zigzag line - select/unselect
3. plot HHLL labels - select/unselect

Both (2 and 3) Higher timeframe setups allow to select higher timeframe and offset. Offset can be 0 or 1. This setting normally used to avoid repainting. Select offset as 1 to avoid repainting.

For Pine script developers:
Script elements:
1. Input parameters
2. Type definition (UDT) for ohlc and ph, pl data elements
3. Map definition for visual properties
4. Type instances for chart_tf, higher_tf1, higher_tf2
5. Important variable – for indicator values
6. Methods –
a. get_ph_pl() – get ph, pl data for each of the tf along with indicator values
b. add_ph(), add_pl() – add ph, pl data to timeframe specific udt, plot the zigzag and labels, add tooltip to label

Script structure
1. Input parameters
2. Variable and type definitions
3. Methods and functions
4. For each of timeframe, call functions and methods
a. Check ph, pl (if swing point formed)
b. Plot ph, pl (if applicable) i.e. zigzag line, labels
Sürüm Notları
Revising the publication with:
1. Changes to left and right bar default parameters
2. Changes to default HTF timeframes
educationalTrend Analysis

Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının yazarı komut dosyasını açık kaynak olarak yayınlamıştır, böylece yatırımcılar betiği anlayabilir ve doğrulayabilir. Yazar çok yaşa! Ücretsiz olarak kullanabilirsiniz, ancak bu kodun yayında yeniden kullanımı Ev kurallarına tabidir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?

Feragatname