INVITE-ONLY SCRIPT

[GYTS-Pro] Signal Provider | WaveTrend 4D with GDM + QMC

Updated
WaveTrend 4D with GDM + QMC (Professional Edition)
🌸 "📡 Signal Provider" in GoemonYae Trading System (GYTS) 🌸

WaveTrend 4D (WT4D) is an extension of the incredible WaveTrend 3D (2022, Justin Dehorty). This oscillator elevates the classic WaveTrend by integrating advanced mathematical models for a multi-dimensional view of market momentum, capturing subtle shifts and trends that traditional indicators might miss. Each oscillator layer uses a combination of normalised derivatives, hyperbolic tangent transformations, and dual-pole filtering (John Ehlers' SuperSmoother), providing a normalised and smooth signals.

WT4D strives to help discriminating high-quality signals from the indicator by introducing the Gradient Divergence Measure (GDM) and Quantile Median Crosses (QMC) -- see below for more information.

WaveTrend 4D is a "📡 Signal Provider" in the 🌸 GoemonYae Trading System (GYTS) 🌸. Multiple 📡 Signal Providers connect to a GYTS "🧬 Flux Composer" to find confluence. On its turn, the Flux Composer can be connected to the GYTS "🎼 Order Orchestrator" for backtesting and trade automation. However, WaveTrend 4D is a wonderful indicator on its own as well.


🌸 --- MAIN FEATURES --- 🌸

- The focus is on two type of signals: divergences between the overall trend and the waves (GDM) and the weakening of strong trends (QMC)
- The name "WaveTrend 4D" is derived from the usage of 4 dimensions, representing different frequencies or timeframes. This gives the opportunity to use 2 sets of 3 frequencies to find divergences. Next to the "fast", "normal" and "slow" frequency, the fourth frequency is called "lethargic" (very slow).
- High probability trading involves diligently determining the significance of signals. For this purpose, a novel "Gradient Divergence Measure" (GDM) is developed to signify the strength of divergence signals and are drawn as triangles next to the divergence circles.
- Another and powerful approach is to use the frequencies' crossing of the median (zero) line. We seek to only signal reversals after a significant trend, and call this the "Quantile Median Crosses" (QMC).

More information the GDM and QMC and details of all features are described below.


🌸 --- GRADIENT DIVERGENCE MEASURE (GDM) --- 🌸

snapshot

💮 Introduction
--
The GDM dynamically calculates a composite measure based on multiple factors. Unlike traditional binary divergence indicators, GDM employs a continuous value system to capture the nuanced dynamics of market behaviour. This methodology allows traders and analysts to assess the potency of divergence signals with greater precision, facilitating more informed decision-making processes.

💮 Methodology
--
The GDM is calculated using a composite formula that integrates various market dynamics. At its core, it consists of six components listed below, each weighted to optimize the indicator's responsiveness to market conditions:

  1. The magnitude of relative change between waves -- A larger difference between the waves, i.e. lower high or higher low could signify a stronger divergence.
  2. The absolute value of the latest wave -- The strength of the latest wave provides insight into the extremity of the market conditions.
  3. Slope of the divergence -- The slope between the two points of divergence essentially measures the rate of change in the frequency\'s value over time. It captures both the direction and the steepness of the indicator’s move between two waves.
  4. The magnitude of relative change of the price -- A divergence means that the oscillator shows an opposite pattern than price action. Thus, if the price makes a significantly higher high or lower low, but the indicator does not, this discrepancy can be used to measure the divergence strength. This components measures the price's extrema during the crosses of the indicator's waves.
  5. Higher timeframe's frequency trend -- Similarly, instead of looking at the price directly, this component measures the more general trend of the price by using the higher timeframe frequency (i.e. the slow frequency when looking at divergences of the normal frequency).
  6. Time duration -- Lastly, the time duration between the two points of a divergence can also be a factor. A divergence that spans over a longer period might indicate a more significant market sentiment shift.


Note that these 6 components are not independent, e.g. the slope is actually the result of the magnitude between waves, the absolute value and time duration. However, the default GDM is carefully tuned to include all these features without being too sensitive to outliers.

💮 Tuning the GDM
--
At the same time, different people have different ideas of what factors are important to denote a "strong" divergence. For this reason, in the 🧰 Professional Edition of this indicator, as opposed to the 🤲 Community Edition, the user can select between different "GDM profiles" that resemble a certain approach:

Upon initiating the GDM indicator, users are prompted to select one of six distinct profiles. Each profile adjusts the indicator’s parameters to optimize performance under different market scenarios:

  • balanced: Offers a general approach, with a balanced assessment of market conditions without specific focus on any one aspect.
  • regular divergence: Emphasises price action, ideal for identifying classical divergence patterns where price and momentum diverge.
  • wavetrend focus: Minimises the influence of price action, concentrating on the WaveTrend oscillator’s behaviour for trend analysis.
  • short-term waves: Prioritises the slope of the waves, targeting traders interested in short-term market movements and potential inflection points.
  • long-term waves: Extends the analysis period, focusing on longer-term market trends and wave duration for strategic positioning.
  • overbought/oversold: Highlights extreme conditions in market valuation, useful for identifying potential reversal points from overbought or oversold levels.


The 🎩 Ultimate Edition takes it a step further and gives full freedom to dial in weights for each of the 6 components. The GDM formula is set up in such way to accommodate ease of use and react logically to these parameters. Having said that, the default GDM calculation should be more than sufficient for most cases.

Another way of tuning the GDM is to dial in the "sensitivity". This controls the extent of normalisation between signals, and essentially affects how often strong GDMs appear. At the conservative end (higher sensitivity), the strong GDMs are less frequent but are relatively significant, while with a lower sensitivity the strong GDMs appear more frequent.

💮 GDM on the Oscillator
--
Coming back to the indicator, the GDMs are represented by triangles and their value represents the strength. A value close to `1` signifies a strong bearish divergence and thus a possible reversal of continuation of a downtrend. Similarly, a value close to `-1` signifies a strong bullish divergence.

Note that there are two colour sets which can be enabled and disabled. One uses crosses between the fast and normal frequencies (with the slow frequency acting as the price trend with which there should be an opposite interaction -- "divergence"). Similarly, crosses between the normal and slow frequencies (with the lethargic (the most slow) frequency acting as the price trend) are used to find divergences on a higher timeframe.


🌸 --- QUANTILE MEDIAN CROSSES (QMC) --- 🌸

snapshot

💮 Introduction
--
A different and powerful approach is to use the frequencies' crossing of the median (zero) line. This would signify a continuation of the reversal. However, also here, not all of those crossings would be trades with a high probability of success. For this reason, we seek to only consider reversals after the most strong trends start to show weakness. We call these reversals the "Quantile Median Crosses" (QMC), derived from the methodology.

💮 Methodology
--
To find this "most strong trends", we calculate the integral ("the area") of a frequency between all historical median crosses, and take an upper quantile of those integrals. This means that when the series is crossing the median in often (consolidation), the ares between those crosses would be small. But if there was a strong momentum, and the series would separate itself significantly from the median and would do so for a long time, its area would be large.

So after considering all the past integrals, we take the upper quantile of those (i.e. sort all integral and for example take the top 5%) and if the latest trend's integral was in this upper quantile, it is considered "significant". Hence, the name "quantile" in the name "Quantile Median Cross"

💮 Tuning the QMC
--
The QMC is easily tuned by its "sensitivity". This basically represents a set of quantile bounds for the normal, slow and lethargic series. We have set these 3 parameters for each sensitivity profile after careful testing. The 🎩 Ultimate Edition gives full control for each quantile bound.

💮 QMC on the Oscillator
--
The QMC is shown as a label "🔴" above the median or with "🟢" below the median. In the 🎩 Ultimate Edition, the user instead sees the exact quantile and the number of samples. The normal frequency has a "bronze" colour, the slow frequency "silver" and the lethargic is "gold". In addition to the labels, there are also diamond shapes in the same colour drawn on the median in the oscillator. This represents the previous median crossing, and helps the user to see between which two points the integral is calculated.


🌸 --- DETAILED FEATURES --- 🌸

As discussed, at its core, the main signals are the Gradient Divergence Signals (GDM) and Quantile Median Crosses (QMC). However, there are more very powerful features that this 📡 Signal Provider can include. Below is a list of all features and we differentiate the availability of a feature per 📡 Signal Provider version by using these icons: 🤲 Community Edition; 🧰 Professional Edition; 🎩 Ultimate Edition.

Before going into the features, there are two important aspects to note: As this is a 📡 Signal Provider, it can be connected to the GYTS 🧬 Flux Composer and this is possible for each edition (i.e. the 🤲 Community Edition 📡 Signal Composer works with the 🤲 Community Edition 🧬 Flux Composer, and the same holds for the 🧰 Professional and 🎩 Ultimate Editions). Contrary to most other indicators that connect with each other, the signals that are passed are not just binary signals ("buy" or "sell") but pass the actual GDM and QMC values. This gives the opportunity in the 🧬 Flux Composer to more accurately use multiple signals with different strengths to finally give an overall signal.

The second important aspect is that for the 🤲 Community Edition, there are two versions of this 📡 Signal Provider: one that has the GDM feature and another the QMC feature. Besides that, the list below depicts a fairly complete overview of all the features across different versions:

  1. ( 🤲 🧰 🎩 ) Four Dimensions -- All four dimensions are available for each edition. The input data can also be transformed with an EMA or CoG as in the original WaveTrend 3D.
  2. ( -- 🧰 🎩 ) Both GDM and QMC -- Only the Pro and Ult versions include both the GDM and QMC in one indicator
  3. ( 🤲 🧰 🎩 ) Custom indicator name -- There's an option to give a name to the indicator which will be displayed on the chart. On its own, it might not be helpful, but in the GoemonYae Trading System (GYTS) suite, it helps to identify the different Signal Providers.
  4. ( 🤲 🧰 🎩 ) Visual improvements -- As in the original WaveTrend 3D, there are various ways the indicator can be displayed, including emphasising a certain frequency, a "mirror mode" and separating each frequency. We have expanded on some of these options. For example, the divergences, GDMs and QMCs are also displayed when the frequencies are separated, the mirror mode works with the emphasised frequency, there are more options to control the width of the emphasised frequency and each frequency can be enabled or disabled.
  5. ( 🤲 🧰 🎩 ) Support for HTF -- The indicator works on higher timeframes than the current chart and all parameters and calculations are scaled accordingly.
  6. ( __ 🧰 🎩 ) Support for other tickers -- There is also an option to select another ticker than the current chart. This especially makes sense in the 🌸 GYTS suite 🌸, where multiple Signal Providers are combined to find confluence. For example, a common approach is to use a certain ETF (or BTC in crypto) on a higher timeframe as filter to determine overall market direction.
  7. ( __ __ 🎩 ) Disable "only true divergences" -- In the Ultimate Edition, less signals can be filtered out when disabling looking at the third frequency. In general, this is not the best idea but it can be helpful when filtering signals with other means.
  8. ( __ 🧰 __ ) GDM profiles -- As mentioned, the GDM is carefully tuned and we consider it an excellent method to signify the strength of a divergence. Therefore, the standard calculation in the Community Edition is sufficient. Nevertheless, the Pro Edition has profiles (as previously described) so the user can select how (s)he feels a "strong divergence" should be.
  9. ( __ __ 🎩 ) GDM weights -- Full control over the weights of the 6 components of the GDM instead of using the profiles. The GDM algorithm is set up in such way that this is possible in an intuitive way.
  10. ( __ __ 🎩 ) Disable asymmetric GDM calculation -- Calculate the bullish and bearish GDMs independently (asymmetric calculation) or normalise them altogether (symmetric calculation). This can sometimes be helpful to filter out weaker GDMs depending on market conditions.
  11. ( 🤲 🧰 🎩 ) QMC calculation -- Using the QMC is possible in all versions, and each of the Normal, Slow and Lethargic frequencies can be toggled on and off.
  12. ( __ 🧰 __ ) QMC sensitivity -- Similar to the GDM profiles, in the Pro version there are presets to make the sensitivity higher (and thus get more signals) or lower.
  13. ( __ __ 🎩 ) QMC quantile threshold -- Instead of the sensitivity presets, in the Ult Edition the quantile threshold for each frequency is set. The user also sees the actual quantile and number of samples in the label
  14. ( 🤲 🧰 🎩 ) WaveTrend 4D settings -- Possibility to adjust the core WaveTrend settings
  15. ( 🤲 🧰 🎩 ) Alerts -- When alerts are enabled, TradingView will notify when there is a bullish/bearish strong GDM (i.e. within the zone) and a bullish/bearish QMC.
Release Notes
Minor update
  • Changed to colours that work better with both white and black background
  • Made a few names and descriptions more user-friendly
  • Improved connection with 🌸 GYTS 🧬 Flux Composer
Release Notes
Updates in short:
  1. MAJOR: added 4 options that define a "divergence". See more below.
  2. Added two '🔗 STREAM-int' for QMC and strong GDM signals data streams; to be used in strategies that require discrete values for signals. Mapping is shared below.
  3. Changed the Gaussian kernel smoothing to the dual pole SuperSmoother (that is already used in the calculation of each series)
  4. Added visualisation option to add QMC and strong GDM signals on price chart
  5. Removed EMA and CoG options for simplicity sake, I don't think many people used it
  6. Significantly sped up QMC calculation


Regarding the new "Divergence definition" setting:
A usual definition of a 'divergence' is when the difference between the respective values of two series (usually price and a certain metric) increase over time. In our case, one is the WT4D series of the frequency in question and the other series is the direction and/or position of the slower frequency. More concretely, the divergence (and GDM) is calculated by taking the peaks/valleys of the (🐇) normal series and compare them with the behaviour of the (🐢) slow. Or, for the other set, that is the (🐢) slow and (🦥) lethargic series respectively.

That 'behaviour' is what we set in this parameter. You can choose to define a divergence when the 🐇/🐢 waves are getting weaker, but the 🐢/🦥 series are going into the opposite direction (option 2). Another way is to choose the 🐢/🦥 series to be positioned above/below zero (option 3, default behaviour). Both of these can also be chosen (option 4), meaning that in bullish scenario the 🐇 series makes higher lows but the 🐢 is above zero and increasing.

Note that with default settings of the series, a divergence will be detected seldom, and because of that the GDM will be very high. Lastly, the first option is to not look at the slower series at all and trigger a divergence when the waves are getting weaker (technically there is no comparison and thus no divergence).


Lastly, the mapping of '🔗 STREAM-int 📡 Gradient Divergence Measure':
  • Strong GDM of slow frequency (bullish) => 2
  • Strong GDM of normal frequency (bullish) => 1
  • Strong GDM of normal frequency (bearish) => -1
  • Strong GDM of slow frequency (bearish) => -2


And '🔗 STREAM-int 📡 Quantile Median Cross':
  • QMC of lethargic frequency (bullish) => 3
  • QMC of slow frequency (bullish) => 2
  • QMC of normal frequency (bullish) => 1
  • QMC of normal frequency (bearish) => -1
  • QMC of slow frequency (bearish) => -2
  • QMC of lethargic frequency (bearish) => -3
CyclesdigitalsignalDivergencegradientdivergencemeasuregytslowpassfiltermultitimeframeanalysisquantilemediancrosssignalsproviderTrend AnalysisWave Analysiswavetrend

Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact GoemonYae for more information, or follow the author's instructions below.

TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases, you can find a good open-source alternative for free in our Community Scripts.

Author's instructions

See signature for more info

Want to use this script on a chart?

Warning: please read before requesting access.

🌸 ----- GoemonYae Trading System (GYTS) ----- 🌸
💬 GYTS Discord server (including YaeBot): discord.gg/ef6Tu4kha3
👔 personal LinkedIn: linkedin.com/in/arthur-nazarian
Also on:

Disclaimer