TradingView
Hutmacher42
25 Oca 2022 10:09

Modified QQE-ZigZag [Non Repaint During Candle Building] 

BTC Perpetual Futures ContractBinance

Açıklama

V V V V V V V Please Read V V V V V V V

I ask Peter and he is fine, that im published this script
Tell me if you have some ideas or criticism about that sricpt

>>>>>>>>>> This is a modified Version of Peter_O's Momentum Based ZigZag [QQE] <<<<<<<<<<<

This is only a test, and i want to share it with the community
It works like other ZigZags

Because Peters_O's original Version is only non repaint on closed historical Data ,
during a Candle building process it can still repaint (signal appears / 21 seconds later signal disapears / 42 seconds later signal appears again in the same candle / etc.),
but that isnt important for backtesting, its only important for realtime PivotPoints during a candle.

My goal for this zigzag was to make it absolute non repaint neither during a candle building process (current candle),
so once the signal is shown there is no chance that it disapers and shown a few seconds later again on that same candle, it can only show up one time per candle an thats it,
and that makes it absolute non repaint in all time frames.

Credits to:
==> Thanks to @glaz , for bringing the QQE to Tradingview <3
==> Thanks to @Peter_O , for sharing his idea to use the QQE as base for a Zigzag
and for sharing his MTF RSI with the Community <3

Changes:
- I changed the MTF RSI a little bit, you can choose between two version
- I changed the QQE a little bit, its now using the MTF RSI , and its using High and Low values as Source to make it absolute non repaint during a candle is building
- I added a little Divergence Calculation beween price and the MTF RSI that is used for the ZigZag

Colors :
- Green for HH / HL Continuation
- Red for LL / LH Continuation
- Yellow for Positive Divergence
- Purple for Negative Divergence

Important:
It is not possible to backtest this script correctly with historical Data, its only possible in Realtime,
because the QQE is using crossunders with RSILowSource and the QQE Line to find the Tops and,
because the QQE is using crossovers with RSIHighSource and the QQE Line to find the Bottoms,
and that means it is not possible to find the correct Time/Moment when that crossovers / crossunders happens in historical Data

=============> So please be sure you understand the Calculation and Backtest it in Realtime when you want to use it,
because i didn't published this script for real trading

=============> Im not a financial advisor and youre using this script at your own risk
=============> Please do your own research

Sürüm Notları

Credits to:
- Thanks to @HeWhoMustNotBeNamed, for sharing his awesome Supertrend Library,
and for sharing his Divergence Detection Script with the Community <3

Update:
- Added Supertrend based on Highest / Lowest Values
- Added Lookback Range for PivotPoints in Div Calculation

Setting Info:
=> RSI
- Rsi-Type : Choose between Cutler's and Wilder's RSI
- Rsi-Len : Set the Length for the RSI
- MTF-Mult : Length Multiplier for RSI to get MTF Resolution
- QQE-Mult : Set the distance between QQE-Line and RSI (works similar like Supertrend)
- Smooth : Smooth the Rsi with EMA

=> Divergence
- Div-Src : choose source for different Rsi, but with the same settings as QQE-RSI
- PPs-Back : choose how many pivot points should be included in the calculation
- Bot-limit : Shows olny the Divs that are under that limit
- Top-limit : Shows olny the Divs that are over that limit

=> Supertrend
- Chl_len : Choose the Lookback range for Lowest / Highest Values
- Show : Hide The Supertrend
- Atr-Len : Choose the Average Length for the Atr
- Atr-Mult : Choose the Multiplier for the Atr

Sürüm Notları

Update:

- some minor fixes
- added Info for all Parameters in the Settings
- added Convergence Calculation
- reworked supertrend Calculation, you can choose between 3 versions:
- SMA based
- EMA based
- Rolling HH / LL based
Yorumlar
kansari3000
I've been testing this script for some time on multiple instruments and different time charts.
What an absolute gem of a ZIGZAG! Congratulations!!

If I could humbly request an addition. Could you update the code to show all zigzag pivots? I noticed a few are ignored (no circles). These seem to be (Lows = to previous Low) and (Highs = to previous High).
Hutmacher42
@kansari3000, Thx <3.

I can add options for the src values like OHLC, if that's what you mean?
kansari3000
@Hutmacher42, I've resolved it by adding "same_bull = zz_bot >= prev_bot_1 ? true : false" and "same_bear = zz_top <= prev_top_1 ? true : false"
Hutmacher42
@kansari3000, i can add the option that the Top can be equal compared to the previous, but im not sure if its still a divergence then
kansari3000
@Hutmacher42, You are right, for analysis purposes, they are not relevant pivots. I needed to take into account all pivots for calculating profit/loss.
kansari3000
@kansari3000, I also added an alma to show overall bullish or bearish trend and labels showing % gain or loss. I can send you the code to test if you wish.
Ether2020
Amazing job my dear friend! Thank you so much for the hard work!
Hutmacher42
@Ether2020, Thank you <3
datta_kota
no doubt you made the best of the best zero-lag in the trading view at present that I came across,
your script is clean and easy to understand!!

Thanks for your support to this community
Hutmacher42
@datta_kota, thx, for your nice words <3
Daha Fazla