▶ Use any indicator to find trend bias. Here we are using simple supertrend
▶ Use any oscillator. I have added few inbuilt oscillators as option. Default used is .
▶ Find divergence by using to detect high/low of price and observing indicator movement difference between subsequent in the same direction.
▶ Combine divregence type, divergence bias and trend bias to derive overall sentiment.
Complete details of all the possible combinations are present here along with table legend
C - Continuation
D - Divergence
H - Hidden Divergence
I - Indeterminate
▶ Zigzag parameters : These let you chose properties. If you check "Use confirmed pivots", then unconfirmed will be ignored in the table and in the chart
▶ Oscillator parameters : Lets you select different oscillators and settings. Available oscillators involve
- CMO -
- COG - Center Of Gravity
- DMI - Index (Only is used here)
- - Moving average convergence divergence (Can chose either histogram or line)
- - Index
- MOM - Momentum oscillator
- TSI - Total Strength Index
- WPR - William Percent R
- BB - Percent B
- KC - Channel Percent K
- DC - Channel Percent D
- ADC - Adoptive Channel Percent D (Adoptive-Donchian-Channel)
▶ Stats : Enables you to display history in tabular format.
Overview of settings present here:
- Trend detection is done only with respect to previous in the same direction. Hence, if chart has too many zigzags in short period, try increasing the length or chart timeframe. Similarly, if there is a steep trend, use lower timeframe charts to dig further.
- Oscillators does not always make at same bar as price. Due to this some the divergence calculation may not be correct. Hence visual inspection is always recommended.
⬜ Possible future enhancements
- More options for trend bias
- Enhance divergence calculation. Possible options include using oscillator based as primary or using close prices based instead of high/low.
- Multi level option - Can be messy to include more than one . Option can be added to chose either Level1 or Level2 zigzags.
- Alerts - Alerts can only be added for confirmed - otherwise it will generate too many unwanted alerts. Will think about it :)
If I get time, I will try to make a video.
- Option to draw zigzag on close prices (selected by default)
- Option to show/hide divergence types.
- Renamed BarIndex in stat table to Bar Time
- Minor updates in layout
By default continuation and indeterminate are disabled for alerts. Note that, when not using confirmed pivots, we may get alerts on every bar as non confirmed pivots keep moving.
Alerts are configured using alert method instead of alertcondition. Hence, you will only see one option. Just need to select the indicator from alert dialog and press create:
Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.
Join tradingview: https://www.tradingview.com/gopro/?share_your_love=sudh