MA VisualizerThe MA Visualizer is made up of 5 Moving Averages (MA)
All MA change color when the price closes above or below the MA line.
The background between the MA line and price will also change color, this creates the Visualizer.
When two or more MA are selected the two visualizer's will combine and create a gradient effect.
Each MA can be adjusted with 6 source selection's to choose from (SMA , EMA , WMA , HMA , RMA , WVMA).
The Visualizer can be turned off while leaving the MA lines turned on and vice versa.
Their is also a MA Cross indicator built-in.
Phân tích Sóng
ZigZag WavesHello All,
I am here with a new idea and script, " Zigzag Waves ". This indicator creates 3 Zigzags with different lengths, keeps the lengths of each zigzag wave and calculates/draws average waves for each zigzag. optionally it can reset the wave when zigzag direction changes and new highest/lowest found. And optionally it draws Exponential Moving Average(EMA) of the sum of waves. This idea is very new and at the moment there is no optimization for the Zigzag Periods. Maybe we altogether can improve the idea and find the best zigzag periods for different symbols and time frames.
Using the options You can play with the periods, add/remove EMA, set its color and reset the waves on new Highest/Lowest. As far as I see resetting the waves on new Highest/Lowest may bring better results.
if we enable "Reset the waves on new Highest/Lowest":
Using different periods and EMA length:
P.S. if you have ideas to improve this script, drop a comment under the script please.
Enjoy!
Intraday Grid trading exampleHello everyone,
This was a grid trading example for intraday trading.
Please be advised that every commodity have diferent kind of reaction and rate of change between periods therefore the percentages need to be adjusted acording to the commodities change %.
In order to specify the adjustment rate we add the Zig Zag in the script.
For Example ;
Last 3 days zigzag high points are %25 , %13 and %8 , the average %is about %9 therefore you have to put the adjustment ratios something like;
Z%1 = %3
Z%2 = %6
Z%3 = %9
Feel free to use the script with caution( it was not a investment advice), this was only a example of grid trading strategy on our trading platform.
Regards.
FunctionZigZagMultipleMethodsLibrary "FunctionZigZagMultipleMethods"
ZigZag Multiple Methods.
method(idx) Helper methods enumeration.
Parameters:
idx : int, index of method, range 0 to 4.
Returns: string
function(method, value_x, value_y) Multiple method ZigZag.
Parameters:
method : string, default='(MANUAL) Percent price move over X * Y', method for zigzag.
value_x : float, x value in method.
value_y : float, y value in method.
Returns: tuple with:
zigzag float
direction
reverse_line float
realtimeofpivot int
Jeges JigsThis is a combination of all my old indicators, with an added feature for trend lines (inspiration for this came from Wedge Maker script thanks to veryfid, I hope he doesn't mind).
This script looks for a period with increased volatility , as measured by ATR ( Average True Range ), then it looks for a high or a low in that area.
When price is above EMA (400 is default, can be changed), it looks for the highs and adds multiples of ATR to the high. Default values for multipliers are 3,9 and 27, meaning that the script will show 3xATR level above the high, 9xATR above the high and 27xATR above the high.
When price is below EMA it looks for the lows and subtracts multiples of ATR from the low.The script will show 3xATR level below the low, 9xATR below the low and 27xATR below the low.
Multipliers values can be changed as well, making it a versatile tool that shows potential levels of suppport/resistance based on the volatility .
Possible use cases:
Breakout trading, when price crosses a certain level, it may show potential profit targets for trades opened at a breakout.
Stoploss helper. Many traders use ATR for their stoplosses, 1 ATR below the swing low for long trades and 1 ATR above the swing high for short trades are common values used by many traders. In this case, the Lookback value comes handy, if we want to look maybe at a more recent value for swing high/low point.
It highlights ATR peaks, it also displays Bollinger bands of SMA400 (or Ema), breakouts for upper/lower bands.
Another thing you get is Parabolic SAR and Zigzag based on SAR.
ZigZag reSampledthis indicator looks like the default ZigZag indicator but it uses the price action instead of the deviation%
Kitti-Playbook Fibonacci retracement GAGE R0.00
Release Notes: Oct 25 2021
OVERVIEW :Kitti-Playbook Fibonacci retracement GAGE R0.00
Easy for visualize Fibonacci retracement level
CONCEPTS
1)Minimum Line = Lowest level of Source form start
2)Maximum Line = Highest level of Source form New Low
3)Calculation
a) Fibonacci Retracement of 61.8% form Maximum level
b) Fibonacci Retracement of 78.6% form Maximum level
c) Fibonacci Retracement of 88.7% form Maximum level
d) Fibonacci Retracement of 94.2% form Maximum level
4)Information Display
a) Information Bar show Number of New Low , Max level , Min Level , Last Bar No, Current Pricel
b) GAGE Scale Number
c) New Low
supertrendHere is an extensive library on different variations of supertrend.
Library "supertrend"
supertrend : Library dedicated to different variations of supertrend
supertrend_atr(length, multiplier, atrMaType, source, highSource, lowSource, waitForClose, delayed) supertrend_atr: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
length : : ATR Length
multiplier : : ATR Multiplier
atrMaType : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
source : : Default is close. Can Chose custom source
highSource : : Default is high. Can also use close price for both high and low source
lowSource : : Default is low. Can also use close price for both high and low source
waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
delayed : : if set to true lags supertrend atr stop based on target levels.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_bands(bandType, maType, length, multiplier, source, highSource, lowSource, waitForClose, useTrueRange, useAlternateSource, alternateSource, sticky) supertrend_bands: Simple supertrend based on atr but also takes into consideration of custom MA Type, sources
Parameters:
bandType : : Type of band used - can be bb, kc or dc
maType : : Moving Average type for Bands. This can be sma, ema, hma, rma, wma, vwma, swma
length : : Band Length
multiplier : : Std deviation or ATR multiplier for Bollinger Bands and Keltner Channel
source : : Default is close. Can Chose custom source
highSource : : Default is high. Can also use close price for both high and low source
lowSource : : Default is low. Can also use close price for both high and low source
waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
useTrueRange : : Used for Keltner channel. If set to false, then high-low is used as range instead of true range
useAlternateSource : - Custom source is used for Donchian Chanbel only if useAlternateSource is set to true
alternateSource : - Custom source for Donchian channel
sticky : : if set to true borders change only when price is beyond borders.
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
supertrend_zigzag(length, history, useAlternateSource, alternateSource, source, highSource, lowSource, waitForClose, atrlength, multiplier, atrMaType) supertrend_zigzag: Zigzag pivot based supertrend
Parameters:
length : : Zigzag Length
history : : number of historical pivots to consider
useAlternateSource : - Custom source is used for Zigzag only if useAlternateSource is set to true
alternateSource : - Custom source for Zigzag
source : : Default is close. Can Chose custom source
highSource : : Default is high. Can also use close price for both high and low source
lowSource : : Default is low. Can also use close price for both high and low source
waitForClose : : Considers source for direction change crossover if checked. Else, uses highSource and lowSource.
atrlength : : ATR Length
multiplier : : ATR Multiplier
atrMaType : : Moving Average type for ATR calculation. This can be sma, ema, hma, rma, wma, vwma, swma
Returns: dir : Supertrend direction
supertrend : BuyStop if direction is 1 else SellStop
zigzag⬜ Zigzag at your fingertips.
Creating zigzag array is more simpler than ever. All you need to do is:
▶ Import library:
import HeWhoMustNotBeNamed// as zgi
▶ And invoke zigzag to get all the details.
zgi.drawzigzag(zigzagLength)
More examples in the code where you can get retracement ratios, zigzag direction, divergence etc.
Library "zigzag"
Library dedicated to zigzags and related indicators
zigzag(length, numberOfPivots, useAlternativeSource, source, oscillatorSource, directionBias) zigzag: Calculates zigzag pivots and generates an array
Parameters:
length : : Zigzag Length
numberOfPivots : : Max number of pivots to return in the array. Default is 20
useAlternativeSource : : If set uses the source for genrating zigzag. Default is false
source : : Alternative source used only if useAlternativeSource is set to true. Default is close
oscillatorSource : : Oscillator source for calculating divergence
directionBias : : Direction bias for calculating divergence
Returns:
zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs : Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
newPivot : Returns true if new pivot created
doublePivot : Returns true if two new pivots are created on same bar (Happens in case of candles with long wicks and shorter zigzag lengths)
drawzigzag(length, numberOfPivots, , source, linecolor, linewidth, linestyle, oscillatorSource, directionBias, showHighLow, showRatios, showDivergence) drawzigzag: Calculates and draws zigzag pivots
Parameters:
length : : Zigzag Length
numberOfPivots : : Max number of pivots to return in the array. Default is 20
: useAlternativeSource: If set uses the source for genrating zigzag. Default is false
source : : Alternative source used only if useAlternativeSource is set to true. Default is close
linecolor : : zigzag line color
linewidth : : zigzag line width
linestyle : : zigzag line style
oscillatorSource : : Oscillator source for calculating divergence
directionBias : : Direction bias for calculating divergence
showHighLow : : show highlow label
showRatios : : show retracement ratios
showDivergence : : Show divergence on label (Only works if divergence data is available - that is if we pass valid oscillatorSource and directionBias input)
Returns:
zigzagpivots : Array containing zigzag pivots
zigzagpivotbars : Array containing zigzag pivot bars
zigzagpivotdirs : Array containing zigzag pivot directions (Lower High : 1, Higher High : 2, Lower Low : -2 and Higher Low : -1)
zigzagpivotratios : Array containing zigzag retracement ratios for each pivot
zigzagoscillators : Array of oscillator values at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagoscillatordirs : Array of oscillator directions (HH, HL, LH, LL) at pivots. Will have valid values only if valid oscillatorSource is provided as per input.
zigzagtrendbias : Array of trend bias at pivots. Will have valid value only if directionBias series is sent in input parameters
zigzagdivergence : Array of divergence sentiment at each pivot. Will have valid values only if oscillatorSource and directionBias inputs are provided
zigzaglines : Returns array of zigzag lines
zigzaglabels : Returns array of zigzag labels
ZigZag Chart with SupertrendHello All,
This script creates Zigzag Chart by using Zigzag waves, so it's timeless chart meaning that no time dependency on X-axis. Optionally it can calculate & show Zigzag Supertrend or Simple Moving Average. Also it can change bar colors of the main chart by trend direction of Zigzag Supertrend.
As seen below, each zigzag wave is a candle on Zigzag chart:
You have a few options and using these options you can find best settings for the securities/timeframes.
You can change Zigzag period, if you change Zigzag Period then all zigzag and the chart is recalculated/reconstructed.
You have option to show Zigzag Supertrend or Zigzag Moving Average, the options you have;
- You can change ATR Length and ATR multiplier for supertrend
- You can change Length for Simple Moving Average
You can change Zigzag candle & wick colors using options. Also you have option to change bar colors according to Zigzag Supertrend direction.
As it's timeless chart, below you can see how/when bar colors and Zigzag Supertrend change:
You can see Simple Moving Average of the Zigzag Candles:
You can play with ATR length and multiplier to find best supertrend:
You can play with the candle & wick colors:
Enjoy!
Multi-ZigZag Multi-Oscillator Trend DetectorThis table is intended to give you snapshot of how price and oscillators are moving along with zigzag pivots.
This is done in the same lines of Zigzag-Trend-Divergence-Detector
But, here are the differences
Table shows multiple oscillator movements at a same time instead of one selected oscillator
Divergence is not calculated and also supertrend based trend. Trend can be calculated based on zigzag movements. However, lets keep this for future enhancements.
This system also uses multiple zigzags instead of just one.
⬜ Process
▶ Derive multiple zigzags - Code is taken from Multi-ZigZag
▶ Along with zigzags - also calculate different oscillators and attach it to zigzag pivot.
▶ Calculate directions of zigzag pivots and corresponding oscillators.
▶ Plot everything in the table on last bar.
⬜ Table components
Table contains following data:
Directional legends are:
⇈ - Higher High (Green)
⇊ - Lower Low (Red)
⭡- Lower High (Orange)
⭣ - Higher Low (Lime)
⬜ Input Parameters
▶ Source : Default is close. If Unchecked - uses high/low data for calculating pivots. Can also use external input such as OBV
▶ Stats : Gives option to select the depth of output (History) and also lets you chose text size and table position.
▶ Oscillators : Oscillator length is derived by multiplying multiplier to zigzag length. For example, for zigzag 5, with 4 as multiplier, all oscillators are calculated with length 20. But, same for zigzag 8 will be 32 and so on.
▶ Available oscillators :
CCI - Commodity Channel Index
CMO - Chande Momentum Oscillator
COG - Center Of Gravity
MFI - Money Flow Index (Shows only if volume is present)
MOM - Momentum oscillator
ROC - Rate Of Change
RSI - Relative Strength Index
TSI - Total Strength Index
WPR - William Percent R
BB - Bollinger Percent B
KC - Keltner Channel Percent K
DC - Donchian Channel Percent D
ADC - Adoptive Donchian Channel Percent D ( Adoptive-Donchian-Channel )
⬜ Challenges
There are 12 oscillators and each zigzag has different length. Which means, there are 48 combinations of the ocillators.
First challenge was generating these values without creating lots of static initialization. Also, note, if the functions are not called on each bar, then they will not yield correct result. This is achieved through initializer function which runs on every bar and stores the oscillator values in an array which emulates multi dimensional array oscillator X zigzag length.
Next challenge was getting these values within function when we need it. While doing so I realized that values stored in array also have historical series and calling array.get will actully get you the entire series and not just the value. This is an important takeaway for me and this can be used for further complex implementations.
Thanks to @LonesomeTheBlue and @LucF for some timely suggestions and interesting technical discussions :)
Momentum-based ZigZag (incl. QQE) NON-REPAINTINGI spent a lot of time searching for the best ZigZag indicator. Difficulty with all of them is that they are always betting on some pre-defined rules which identify or confirm pivot points. Usually it is time factor - pivot point gets confirmed after a particular number of candles. This methodology is probably the best when market is moving relatively slow, but when price starts chopping up and down, there is no way the ZigZag follows accurately. On the other hand if you set it too tight (for example pivot confirmation after only 2 or even 1 candle), you will get hundreds of zigzag lines and they will tell you nothing.
My point of view is to follow the market. If it has reversed, then it has reversed, and there is no need to wait pre-defined number of candles for the confirmation. Such reversals will always be visible on momentum indicators, such as the most popular MACD. But a single-line moving average can be also good enough to notice reversals. Or my favourite one - QQE, which I borrowed (and improved) from JustUncleL, who borrowed it from Glaz, who borrowed it from... I don't even know where Quantitative Qualitative Estimation originates from. Thanks to all these guys for their input and code.
So whichever momentum indicator you choose - yes, there is a pick-your-poison-type selector as in in-famous Moving Average indicators - once it reverses, a highest (or lowest) point from the impulse is caught and ZigZag gets printed.
One thing I need to emphasize. This indicator DOES NOT REPAINT. It might look like the lines are a bit delayed, especially when compared to all the other ZigZag indicators on TradingView, but they are actually TRUE. There is a value in this - my indicator prints pivot points and Zigzag exactly on the moment they have been noticed, not earlier faking to be faster than they could be.
As a bonus, the indicator marks which impulse had strength in it. It is very nice to see a progressing impulse, but without force - a very likely that reversal on a bigger move is happening.
I'm about to publish some more scripts based on this ZigZag algo, so follow me on TradingView to get notified.
Enjoy!
Trading ABCHello Traders,
For a few months I have been getting requests from my followers about ABC pattern and finally I decided to make this indicator.
How it works?
- It creates Trend Cloud using Simple and Exponential moving averages with the lenghts 50, 100, 150, 200, 20, 40 by default and checks the trend. you can change the lengths as you wish
- It also creates ZigZag using the ZigZag Period in the options.
- Using last 2 zigzag waves it checks if there is suitable ABC pattern according the Trend, the Min/Max Fibonacci levels and Error Rate
- Then it check if the price bounces after this ABC pattern
- And if all these conditions met then it plot triangle
- If there are multiple bouncing then you can see multiple triangles
You can change/set;
- Zigzag Period
- Fibonacci Max level
- Fibonacci Min Level
- Error Rate
- The Lengths that are used for Moving Averages
- Keeping old ABC lines/labels
- Show Zigzag and min/max Fibonacci levels
- Show Trend Cloud
- and colors
if you don't want to see old ABC lines/labels you can disable it:
if you don't want to see Trend Cloud you can disable it:
Zigzag and Fibonacci levels:
P.S. if you have new ideas to improve this indicator then let me know please. We together can do this life easier!
Enjoy!
Average Zigzag Range (AZR)Here is an attempt calculate Average Zigzag Range (AZR). This can be used similar to ATR. Using AZR instead of ATR for trailing stop calculation may yield better outcome in trend trading.
Logic is simple.
Calculate zigzag based on ZigzagLength
Calculate distance between each zigzag pivots
Calculate simple moving average of last MALength pivots
Use DoubleMA option to further smooth AZR using a Secondary Moving Average
Zigzag CloudThis is Bollinger Band built on top of Zigzags instead of regular price + something more.
Indicator presents 7 lines and cloud around it. This can be used to visualize how low or high price is with respect to its past movement.
Middle line is moving average of last N zigzag pivots
Lines adjacent to moving average are also moving averages. But, they are made of only pivot highs and pivot lows. Means, line above moving average is pivot high moving average and line below moving average is pivot low moving average.
Lines after pivot high/low moving averages are upper and lower bolllinger bands based on Moving Average Line with 2 standard deviation difference.
Outermost lines are bollinger band top of Moving average pivot high and bollinger band bottom of moving average pivot low.
Weis Wave Volume NumbersWhat is it?
This is an indicator to complement @modhelius' Weis Wave Volume Indicator.
Original code has been modified to display wave volume (cumulative) numbers above or below the latest candle of the corresponding wave on the main pane. Since we are concerned only with relative volume, VOLUME NUMBERS HAVE BEEN SCALED DOWN. (If you need actual volume numbers, uncheck "Scale Down Volume" option in Settings). Rising wave volume is denoted in green. Falling wave volume is denoted in red. Developing wave volume is postfixed with a '_'. Confirmed wave volumes won't have this.
Who is it for?
This indicator is useful if you already use Weis Waves in your analysis and could do with an additional numerical representation of the wave volume on the main pane. Can be used in conjunciton with @modhelius' Weis Wave Volume (WWV) indicator (need to be added separately) to complement the visual representation of the waves. Can be used independently as well.
Pelase note that if you use any other Weis Wave indicator (other than @modhelius'), the numbers and the waveforms might not match.
Elliot Wave - ImpulseLets dabble a bit into Elliot Waves.
This is a simple script which tries to identify Wave 1 and 2 of Elliot Impulese Wave and then projects for Wave 3.
Ratios are taken from below link: elliottwave-forecast.com - Section 3.1 Impulse
Wave 2 is 50%, 61.8%, 76.4%, or 85.4% of wave 1 - used for identifying the pattern.
Wave 3 is 161.8%, 200%, 261.8%, or 323.6% of wave 1-2 - used for setting the targets
Important input parameters
Length : Zigzag Length. Keep the numbers low if you are looking for smaller and shorter trades. Keep the numbers high if you are looking for longer and bigger trades.
Error Percent : Adjustments for ratios as it is not always possible to find exactly equal retracement ratio.
Entry Percent : Once Wave 2 is formed, entry is set after reversing 30% of wave 2. This number can be increased or decreased. Caution: Keeping the number too low may result in false signals.
Ignore Trend Direction : If unchecked, it will only look for pattern if Wave 1 has made a higher high. If not, it will ignore Wave 1 condition and only look at wave 1 to 2 ratio.
Handle Duplicates : Since, the labels are generated upon crossover of entry price, this crossover may happen multiple times. Or sometimes wave 2 can further extend and generate new signal with same wave 1. This parameter says how to handle such cases. Keep Last is set to default and is most preferred option.
ShowRatios and ShowWaves lets you display wave line and retracement ratios for each pivots
Linear Regression & RSI Multi-Function Screener with Table-LabelHi fellow traders..
Happy to share a Linear Regression & RSI Multi-Function Custom Screener with Table-Labels...
The Screener scans for Linear Regression 2-SD Breakouts and RSI OB/OS levels for the coded tickers and gives Summary alerts
Uses Tables (dynamica resizing) for the scanner output instead of standard labels!
This Screener cum indicator collection has two distinct objectives..
1. Attempt re-entry into trending trades.
2. Attempt Counter trend trades using linear regression , RSI and Zigzag.
Briefly about the Screener functions..
a. It uses TABLES as Labels a FIRST for any Screener on TV.
b. Tables dynamically resize based on criteria..
c. Alerts for breakouts of the UPPER and the LOWER regression channels.(2 SD)
d. In addition to LinReg it also Screens RSI for OB/OS levels so a multifunction Screener.
e. Of course has the standard summary Alerts and programmable format for Custom functions.
f. Uses only the inbuilt Auto Fib and Lin Reg code for the screener.(No proprietary stuff)
g. The auto Zigzag code is derived(Auto fib).
Question what are all these doing in a single screener ??
ZigZag is very useful in determining Trend Up or Down from one Pivot to another.
So Once you have a firm view of the Current Trend for your chosen timeframe and ticker…
We can consider few possible trading scenarios..
a. Re-entry in an Up Trend - Combination of OS Rsi And a Lower Channel breach followed by a re-entry back into the regression channel CAN be used as an effective re-entry.
b. Similarily one can join a Down Trend on OB Rsi and Upper Channel line breach followed by re-entry into the regression channel.
If ZigZag signals a range-bound market, bound within channel lines then the Upper breakout can be used to Sell and vice-versa!
In short many possibilities for using these functions together with Scanner and Alerts.
This facilitates timely PROFITABLE Trending and Counter trend opportunities across multiple tickers.
You must give a thorough READ to the various available tutorials on ZigZag / Regression and Fib retracements before attempting counter trend trades using these tools!!
A small TIP – Markets are sideways or consolidating 70% of the time!!
Acknowledgements: - Thanks a lot DGTRD for the Auto ZigZag code and also for the eagerness to help wherever possible..Respect!!
Disclaimer: The Alerts and Screener are just few tools among many and not any kind of Buy/Sell recommendations. Unless you have sufficient trading experience please consult a Financial advisor before investing real money.
*The alerts are set for crossovers however for viewing tickers trading above or below the channel use code in line 343 and 344 after setting up the Alerts!
** RSI alerts are disabled by default to avoid clutter, but if needed one can activate code lines 441,442,444 and 445
Wish you all, Happy Profitable Trading!
Auto Fib Time Zones and Trend-Based Fib Time by DGTFibonacci time zones, based on the Fibonacci number sequence, are vertical lines that represent potential areas where a swing high, low, or reversal could occur.
Trend-Based Fib Time shows probable price corrections in an existing trend. A useful tool to use in addition to Elliot Wave counting, Fib Time helps to identify how far the wave is likely to travel
Please note, Time zones aren't concerned with price, only time
Disclaimer :
Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely
The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script
Zig Zag Channels [LuxAlgo]The Zig Zag indicator is a useful indicator when it comes to visualizing past underlying trends in the price and can make the process of using drawing tools easier. The indicator consists of a series of lines connecting points where the price deviates more than a specific percentage from a maximum/minimum point ultimately connecting local peaks and troughs.
This indicator by its very nature backpaints by default, meaning that the displayed components are offset in the past.
🔶 USAGE
The Zig Zag indicator is commonly used to returns points of references for the usage of specific drawing tools, such as Fibonacci retracements, fans, squares...etc.
The proposed indicator estimates peaks and troughs by using rolling maximums/minimums with a window size determining their significance. This window size approach allows us to have an indicator that works with a certain regularity no matter the scale of the price, something the percentage-based approach struggles with. Additionally, one upper and lower extremity are displayed, highlighting the price point that deviates the most from the Zig Zag lines.
A common usage also includes the easy determination of Elliot wave patterns in the price.
The Zig Zag indicator above highlights a downtrending motive wave.
🔹 Extremities
The novel approach taken by this Zig Zag indicator is the addition of two extremities derived from the distance between the price and the Zig Zag line, thus returning channels. It is uncommon seeing extremities in Zig Zag indicators since the line connecting peaks and troughs has rarely any other utility than seeing trend variations with more clarity and is not meant to provide an accurate estimate of underlying local trends in the price.
This channel can be useful to study the potential relationship between underlying trends and the Zig Zag line. A low width between the Zig Zag and the upper extremity indicates price variations mostly located below the Zig Zag while equal width indicates more linear trends.
When the indicator is extended to the last line, the extremities provide potential support and resistances, thus making this indicator able to forecast price variations.
🔶 SETTINGS
Length: Determines the significance of the detected peaks and troughs.
Extend To Last Bar: Extend the most recent line to the most recent closing price value.
Show Extremities: Displays the extremities.
Show Labels: Display labels highlighting the high/low prices located at peaks and troughs.
🔹 Style
Upper Extremity Color: Color of the upper extremity displayed by the indicator.
Zig Zag Color: Color of the ZigZag lines.
Lower Extremity Color: Color of the lower extremity displayed by the indicator.
ZigZag (Using Line Array)This is standard zigzag indicator. I just coded them using lines array feature of pine - so that it can be done in least number of lines of code.
Few possible improvements:
Use label array to mark HH, HL, LH and LL
Add standard deviation check
Detrended Rhythm Oscillator (DRO)How to detect the current "market beat" or market cycle?
A common way to capture the current dominant cycle length is to detrend the price and look for common rhythms in the detrended series. A common approach is to use a Detrended Price Oscillator (DPO). This is done in order to identify and isolate short-term cycles.
A basic DPO description can be found here:
www.tradingview.com
Improvements to the standard DPO
The main purpose of the standard DPO is to analyze historical data in order to observe cycle's in a market's movement. DPO can give the technical analyst a better sense of a cycle's typical high/low range as well as its duration. However, you need to manually try to "see" tops and bottoms on the detrended price and measure manually the distance from low-low or high-high in order to derive a possible cycle length.
Therefore, I added the following improvements:
1) Using a DPO to detrend the price
2) Indicate the turns of the detrended price with a ZigZag lines to better see the tops/bottoms
3) Detrend the ZigZag to remove price amplitude between turns to even better see the cyclic turns ("rhythm")
4) Measure the distance from last detrended zigzag pivot (high-high / low-low) and plot the distance in bars above/below the turn
Now, you can clearly see the rhythm of the dataset indicated by the Detrended Rhythm Oscillator including the exact length between the turns. This makes the procedure to "spot" turns and "measure" distance more simple for the trader.
How to use this information
The purpose is to check if there is a common rhythm or beat in the underlying dataset. To check that, look for recurring pattern in the numbers. E.g. if you often see the same measured distance, you can conclude that there is a major dominant cycle in this market. Also watch for harmonic relations between the numbers. So in the example above you see the highlighted cluster of detected length of around 40,80 and 120. There three numbers all have a harmonic relation to 40.
Once you have this cyclic information, you can use this number to optimize or tune technical indicators based on the current dominant cycle length. E.g. set the length parameter of a technical indicator to the detected harmonic length with the DRO indicator.
Example Use-Case
You can use this information to set the input for the following free public open-source script:
Disclaimer
This is not meant to be a technical indicator on its own and the derived cyclic length should not be used to forecast the next turn per se. The indicator should give you an indication of the current market beat or dominant beats which can be use to further optimize other oscillator or trading related settings.
Options & settings
The indicator allows to plot different versions. It allows to plot the original DPO, the DRO with ZigZag lines, the DRO with detrended ZigZag lines and length labels on/off. You can turn on or off these version in the indicator settings. So you can tweak it visually to your own needs.
Zig Lines with Percent & ValueOverview, Features, and Usage:
The Zig Lines with Percent & Value is an indicator that highlights the highest and lowest points of the market from pivot points and zigzag lines based on the ZigZag Period setting. By a default value of 13 for the ZigZag Period this works well on Bitcoin or other alt coins on the 1 hour or higher timeframe charts.
What makes this indicator unique is that it draws a green line to signify an uptrend or a red line to signify a down trend. It will also show the percent difference between the previous point/line, for example: If you see a -negative percentage point with a red line drawn to it, then you are looking at a low pivot point and then as the green line is drawn to a +positive percentage value the percentage you see is the difference between the two points. This is great to see a trend reversal as you can look at previous pivot points and notice about how far the price moves before it changes direction (trend reversal).
There is an invisible EMA line that is used to assist with coloring the negative vs positive values. The value above or below the percentage is the lowest or highest price at that pivot point . The display of the price at the pivot point depends on your ZigZag Period setting and the timeframe of your chart.
Added Bollinger Bands as it fits perfectly with the visuals of the Zig Lines & Pivots.
Usage of Bollinger Bands:
~As the price or candle gets close to the top or bottom of the Bollinger band it can give you a better confirmation that the pivot location is at it's final place, and the trend is more likely to switch directions.
It’s important to know this indicator should not be used for alerts of any type it does repaint as the green or red line is drawing based on live chart data and it can change depending on the direction of the market. This is a great visual tool for trend analysis or to be used with other indicators as a confirmation for a possible good entry or exit position.
Credits ( and consent to use ):
Credits go to user LonesomeTheBlue for creation of this 'Double Zig Zag with HHLL' script.
The addition of the Value above/below the Percentages is from user Noldo and that script is found here:
The Bollinger Bands setup was suggested by user countseven12 and his script that uses the same BB setup is found here:
References:
1. Chen, James. (2021 March 15). Zig Zag Indicator . Received from http: www.investopedia.com
2. Mitchell, Cory. (2021 April 30). Pivot Points . Received from http: www.investopedia.com