Zigzag SARThis is another ZigZag script. But the difference between this and other ZigZag indicators on TV is that here we find highs and lows based on Parabolic SAR.
It repaints?
YES.
On last line of ZigZag you get repainting, because the highs and lows get confirmation only if direction (SAR dots) changes.
This shouldn't be used to forecast highs and lows directly anyway, it's just a visual guide for past highs and lows.
I'm using it to spot harmonic patterns and Wolfe waves more easily. The plan is to draw these automatically in the future, but my skills at Pinescript are limited at the moment.
PS. Ideas for my scripts are coming from @Jegejig1 on Stocktwits, if you want to know who to blame lol
Индикатор ЗигЗаг (ZigZag)
Zigzag Candles SupertrendHere it is, as promised, supertrend based on Zigzag candles.
Earlier scripts on the Zigzag Candles expedition are here:
Zigzag-Candles
Zigzag-Candles-MA
Zigzag candles parameters Length and CandleSize remain as is. Along with this, we also add MALength and AtrMult to calculate ATR based on the new candles and to use it to derive supertrend.
UseZigzagCandles - selecting this will apply supertrend on zigzag candles and ignore the actual price candles completely.
UseClosePrices - Uses close price as base instead of high/low. Can be used in both modes of price candles and zigzag candles.
Zigzag Candles MAWe have the candles here: Zigzag-Candles
Lets create moving average!!
Just simple moving average at the moment. Since, items are in array. Not so easy to use standard functions of pine. Hence, will take that for future enhancements.
ATR and Supertrend next!!
Zigzag CandlesCan't deny that I am obsessed with zigzags. Been doing some crazy experiments with it and have many more in pipeline. I believe zigzag can be used to derive better trend following methods. Here is an attempt to visualize zigzag as candlesticks. Next steps probably to derive moving average, atr (although there was an attempt of AZR made earlier) and probably supertrend too ;)
Input parameters include ZigzagLength (to calculate zigzag) and CandleSize (number of zigzag pivots in each candle)
CandleSize can be 3 or more. Every time we collect pivots which are equal to CandleSize, we derive one candle. And when we derive a candle, we remove all old pivots except the last one. Becauase, the last pivot acts as open to the next bar and is required.
Body of the candle tells the start and end zigzag pivot in the range. And Wicks signify highest and lowest pivots in the range. High and Low wicks are placed at the pivot where high and lows are formed. Hence, you can see them at different positions each time.
Thanks to @RicardoSantos for suggesting boxes for candles - while I was trying to achieve this with plotbar
Multilevel ZigZag SupertrendVery much similar to :
I have slightly changed code to accommodate multiple zigzags. Also removed possibility of external source to keep it simple.
Indicator shows 2 Level zigzag based supertrends. Second zigzag used is multi level zigzag and hence, this acts as higher timeframe filter and can be considered as overall trend bias.
Multi ZZ - Support/ResistenceExperimental and probably can be improved further.
Method of deriving support/resistence is as follows:
Calculate Zigzags and start pushing them to SR array as and when they form
If any of the existing item is within the small distance - merge them. ATR is used to find if the prices are close by.
Whenever we merge two pivots, strength of support keeps increasing. This means, price has bounced off this point more time. Hence, keep track of number of pivots merged together.
Keep removing old pivots which are far away based on Loopback input
And that's all we got the full list of support and resistence points.
Now, to filter insignificant pivots, chose only those points which has been merged by more than Min Pivots input. Width of the support/resistence lines also will be thicker for the pivots which has more count. Hence thicker line imply strong support and resistence whereas the thinner ones are minor ones.
Multiband Oscillator - Zigzag versionJust variation of Multi Band oscillator present here: Multi-Band-Channel-Oversold-Overbought-Oscillator
Changes are:
Instead of regular moving average, here I am using Zigzag Moving average. This is calculated in similar to as explained in: Zigzag-Cloud
Instead of ATR, using AZR (Average Zigzag Range) - Average-Zigzag-Range-AZR
Rest of the logic remains same.
Number of bands used 100 - which means, calculate 100 Bollinger bands with Std Dev Multiplier starting from 0.1 and with step 0.1 for the next one.
Which divides price ranges into 200 equal parts. Calculate what is the current range and plot them.
Overbought - Oversold levels are dynamics. They are dependent on the max and min state price has reached in last 80 days. Offset and factor can be used to adjust overbought oversold levels.
Multi Level ZigzagAt first I thought of doing double zig zag. Once developed I thought it is not much effort to make it multi level zigzag. This script is not same as multi-zigzag indicator (link in the end). In multi zigzag indicator we use zigzag based on different length and each zigzag has no relation to each other. In this script however, each zigzags are related to each other. We cannot just derive Zigzag 4 without deriving Zigzag 3. (Though we can hide each of them individually)
The logic is simple.
Zigzag1: This is the basic zigzag plotted based on given length.
Zigzag2, Zigzag2, Zigzag3 : These are built based on lower level zigzags.
For example, Zigzag2 is built based on Zigzag1 pivots. For calculation, we just use N*2 number of Zigzag1 pivots to derive the next level. Similarly Zigzag2 will become input for Zigzag 3 and Zigzag3 will become input for Zigzag4
Input parameters allow you to chose upto 4 levels of zigzag along with zigzag line color and length. Max array lines also defines how many lines back you want to calculate the zigzag pivots and display then in the stats. Lowering this number will not reduce the number of lines - but, it will limit possibility of calculating higher level zigzags. Stats table just highlight which pivots are applicable for which outer level.
Application: Can be used in pattern recognization scripts to improve accuracy.
Disclaimer: This is not working in intraday charts. Nothing I could do at this point of time. Use it only for daily + timeframes.
Related scripts:
Multi ZigZag EW - Impulse V2Another version of Elliot Wave 3 projection. This time with more features.
I have based the calculations based on Wave 1,2 and 3 relation mentioned in www.esignal.com
Ratios for Wave 2
Wave 2 = either 50% of Wave 1 or 62% of Wave 1
Wave 3 is related to Wave 1 by one of the following:
Wave 3 = either 1.62 x length of Wave 1 or 2.62 x length of Wave 1 or 4.25 x length of Wave 1
Logic and calculations are similar to that of previous version:
But, effort has been made to add some additional infomation and tools into this script.
Similar to the previous script, upto 4 zigzag lengths can be selected from input. Users can also set, color, line style and width for each Zigzag lines. Error threshold defines how much vairation from fib ratios are allowed before recognizing patterns. EntryPercent is minimal bounce off required from Wave 2 to get into the trade. This will also determine initial Stoploss.
Now lets have look at fun features.
In Trade Stats Table
By default, you can find this in bottom right corner of the screen. This table shows details of trades which are running at the moment based on different patterns formed. Trade will be running till it hits target 4 or trailing stop loss. Multiple zigzags can generate multiple trades at a time, stats containing Wave Points 0 to 3 and other information will be printed in the table.
Closed Trades Stats Table
This is by default found in bottom left corner of the screen. This table consists of stats related to all the closed trades. It shows how many trades are generated, how many failed to hit Entry point, how many hit Entry and then reversed to hit stoploss. How many entered trades hit different stop levels etc.
Unique Coordinates: Sometimes different zigzags produce same waves - Point (1) (2) abd (3). Enabling unique coordinates will filter these and generate only one trade altogether.
AtrLength and AtrMult are used for calculation of trailing stop loss. Trailing stop loss activation can be controlled by the parameter TrailingStart - which lets you select upon reaching what state the trailing stop needs to be activated. Even if trailing stop is not activated, stops will still trail by two levels. For example, when price hits Target 3, stoploss is automatically moved to Target 1 which is below two levels.
In the chart, the remaining Target levels and Current stop levels are highlighted with bigger font and solid lines whereas the inactive ones will have dotted lines and smaller font. For example, Entry label and line will show up in bigger font till price crosses entry. Once this is done, Entry point is not significant anymore. Hence, they are diminished. Similarly target levels will diminish as and when they are reached.
Last parameter is Direction - this lets you select what direction you want to generate the signals. By default it is set to all. But, users can select only bullish or bearish signals.
Multi ZigZag EW - ImpulseSimilar to the previous script on Elliot Wave Impulse:
But, here we are trying to use multiple zigzags instead of just one.
You can select upto 4 different Zigzags and set different length, line color, line width and style for each. Parameters ShowZigZag , ZigZag Length, ZigZag Color, ZigZag Width, ZigZag Style can be used for adjusting these.
ErrorPercent lets you set error threshold calculation of ratios for pattern identification
EntryPercent is used for marking Entry and T.Stop (Tight Stoploss) based on the length of Wave 2.
Target of the script is same as before. We are trying to identify Wave 1 and 2 of Elliot Impulese Wave and then project Wave 3. Chances of price following the pattern are there. Hence, we set Stoploss based on levels which fails the pattern.
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
Since we use multiple zigzags, labels can be quite messy at times. In such scenarios, just disable one of the zigzag length causing label overlaps.
Multi ZigZagI created this as basis for my next scripts. We are just trying to plot multiple zigzags with different length basis here. Input allows you to select different Length , Width , Color and Line Style for each Zigzags.
Max_pivot_size says how many pivots each Zigzag can have. Value 100 means, each zigzag will show 99 lines joining 100 points.
Additional option ShowStatsTable allows you to print pivots in a table. Table only shows selected zigzags.
Musashi_HarmonicPricerMusashi HarmonicPricer was designed to my a tool for my personal trading strategy, and help me plot what I call ''Harmonic Structure', which is just a sophisticated way of using Fibonacci ratios based on the Elliott Wave Principle, Harmonic Patterns, and market structure.
- A distinctive element will be the integrated Fibonacci cluster tool, which plots automatically retracements and extensions of .272 (red) and .618 (purple) ratios, using the last two significant swings. For powerful usage, adjust the timeframes until they group into clusters or adjust the setup. You can also adjust the settings and select to plot only retracement, only extensions, both (default), the deviation (default = 7), and the historical approach.
- To be used wisely properly, you require multi-timeframe analysis, reason why you will find Monthly and Yearly VWAPs, as they won't change while you're switching timeframes, and fib-based EMAs to provide trend and dynamic support.
- Finally, the indicator will plot in price Hidden and Regular divergences for any oscillator you have on screen.
Have a good day.
Elliott Wave [MS]Elliott Wave counter for TradingView! Automatically count Elliott waves on any asset and any timeframe. The script will count in-progress patterns as well as show past patterns that have completed (adjustable in Settings).
Simple to use, just add to your chart and choose how big of waves you're looking for with the Size setting.
Smaller numbers will auto count smaller sized Elliott Waves.
Larger numbers will auto count bigger sized Elliott Waves.
Scan for multiple size waves by adding the indicator to your chart multiple times.
Settings
Size - Set how big or small of waves you want to scan for
Hide Failed Patterns - Show or hide past waves that didn't get to 5
Color Mode - Set your own colors for each wave
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.
Double Top/Bottom - UltimateHellow traders, this is my final script regarding double top/bottom pattern recognition. This script is built based on zig zag indicator whereas the previous ones are built based on pivot points.
Double Top:
Recognition - Checks on Zigzag if LH is followed by HH
Confirmation - When low crosses under last lower pivot point on zigzag
Invalidation - When high crosses over HH
Double Bottom:
Recognition - Checks on Zigzag if HL is followed by LL
Confirmation - When high crosses over last higher pivot point on zigzag
Invalidation - When low crosses under LL
Few major changes in this version compared to previous ones:
Zigzag offers more simplicity in deriving the pattern and also enahnces accuracy. Things such as pivot distance, absolute peaks are removed as they are redundant.
Option to display risk per reward which defines how steep is the W-M triangle. This is simply the ratio of price difference between mid point to top most and bottom most points. In case of double top, downside is considered as reward and upside is considered as risk and with double bottom, downside is considered as risk and upside is considered as reward. Lower risk per reward signifies better trade.
Option to display stats which shows number of occurances of double top and bottom and how many times price crossed confirmation point and invalidation point (which are also marked with dashed lines) Stats are color coded. Higher success rates are colored in shades of green, lower success rates are colored in shades of orange whereas the neutral success rates are coloed in light yellow.
Example of stat shown in Neutral shade. I could not find any instrument which had confirmation rate less than 0.4 - which suggests confirmation rate for the patter is pretty strong:
Links for the other two scripts are here:
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
Martyv Auto Fib Retracement with Logarithmic SupportSimple & easy auto-fib levels. Took the out-of-the-box version provided by TradingView and added Logarithmic support and a nicer palette, and made the controls a bit nicer to use (in my opinion lol). Enjoy.
Swing Failure Pattern Inquisitor SFP Inquisitor
v0.2a
coded by Bogdan Vaida
Code for Swing High, Swing Low and Swing Failure Pattern.
Note that we're still in the alpha version, bugs may appear.
Note that the number you set in your Swing History variable
will also be the minimum delay you see until the apples appear.
This is because we're checking the forward "history" too.
The SFP will only check for these conditions:
- high above Swing History high and close below it
- low below Swing History high and close above it
In some cases you may see an apple before the SFP that "doesn't fit"
with the SFP conditions. That's because that apple was drawn later and
the SFP actually appeared because of the previous apple .
20 candles later.
Legend:
🍏 - swing high
🍎 - swing low
🧺 - candle where the last swing was driven from
🍌 - swing failure pattern
🍎🍌 - hungry scenario: swing low but also a SFP compared to the last swing
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
ScalpingSystem 2.0 @MishuComplete scalping strategy with all related indicators.
1) Wait for an up/down-trend (10 EMA (Orange) crosses ABOVE/Below 20 EMA (Blue))
2) Wait for price to breakout then retest the EMA's (either one(based on the trend type))
3) Wait for bullish/bearish confirmation candle after the retest
4) Enter after the confirmation candle
5) Set a stop loss underneath the previous swing low (previous Zigzag point)
6) Take profit one the EMA's cross the other direction (10 EMA crosses BELOW/ABOVE 20 EMA)
Standart Strategy
with the second trend (higher TF)
zigzag included (@author=lucemanb)
if you have a number of signals you can filter the first signal
Pivot Detective Indicator v1.0Overview of Features
The Pivot Detective is an indicator that simply highlights the waves of the market by identifying the pivot highs and pivot lows by using shapes and zigzag lines.
What makes this indicator unique is that you do not have to specify the number of bars to the left or right side of the pivots (aka pivot strength), nor do you need to specify percent deviation for filtering the zigzag (1)lines. Thus, the indicator will monitor price action and keep track of pivot high and low prices and implements a common trend analysis algorithm to determine when the trend has reversed to confirm the pivot price and begin tracking the next pivot price. The tolerance of the trend reversal can be configured to be strict or loose depending on your preference.
Be aware that this indicator does not determine key levels of price like support (S1, S2, etc.) and resistance (R1, R2, etc.) levels that are found in the traditional Pivot Points indicators (2).
Usage Information
The indicator can be applied to any chart at any time frame. It is very customizable where you can add or change various chart elements to help you enhance your interpretation of the price action trend reversals at the pivots. You can specify the pivot shapes, colors, and visibility as well as zigzag line thickness, color, and visibility. You can adorn the pivot shapes with any combination of price, rate of change percentage, and pivot trend using HH/LH/LL/HL text as well as control the coloring schemes for the in-progress pivot. The size of the text can also be customized.
Be aware that this indicator makes use of lines and labels which are limited to 500 lines and 500 labels, so if traverse far into the history, they will not appear because they have reached these limits and were removed by the chart's rendering engine.
Lastly, you can define "any alert() function call" messages on the "New Pivot High Point" and "New Point Low Point" events. These alerts provide custom placeholders that can be used in the messages, which are: {{exchange}}, {{ticker}}, {{currency}}, {{new_pivot_point_price}}, and {{new_pivot_point_roc}}
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
Zig Zag ArmonyThis script try to help to identify flips and armonies using open and close values nstead hight and lows values.
For newbies, this script help to mark key levels for tendency continuation & breaking off
For flips and armony levels identification
3 levels recommended
30 Bars / Purple / line 5
15 Bars / Red / line 4
5 Bars / Black / line 3
Based on "Zig Zag High Low por Tr0sT"
LTB Zigzag CirclesHello All,
Today I am here with a new idea and script, " LTB Zigzag Circles ". The idea is to create Circles using last 2 zigzag waves and to catch the breakouts earlier than horizontal lines. if a circle is broken then the script shows entry for Long/Short positions. and if broken circle reappears again then the position is closed. You can change Zigzag period as you wish and see the different results.
Here you can see how the script calculates and draws the Circles:
Below you can see how the script draws part of the circle on each bar:
Optionally the script can show levels:
P.S. I haven't tested it as a strategy, Result and Performance may change by Zigzag period, you need to find best Zigzag period according to your strategy. By the way, my Zigzag Circles idea can be improved, if you have any recommendation let me know please ;)
Enjoy!