[GYTS-CE] Signal Provider | WaveTrend 4D with GDMWaveTrend 4D with Gradient Divergence Measure (Community 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 normalised and smooth signals with minimised lag.
The name "WaveTrend 4D" is derived from the usage of 4 dimensions, representing different frequencies or timeframes. Next to the "fast", "normal" and "slow" frequency, the fourth frequency is called "lethargic" (very slow). This gives the opportunity utilise more dimensions without having abundant signals, since we quantify and filter the quality of signals.
WT4D strives to help discriminating high-quality signals from the indicator by introducing the Gradient Divergence Measure (GDM) and Quantile Median Crosses (QMC). For simplicity, speed and focus, this particular indicator includes only the GDM part. Check the other 🤲Community Edition of this indicator that focuses on the QMC. For GDM, see below for more information.
🌸 --- GRADIENT DIVERGENCE MEASURE (GDM) --- 🌸
💮 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:
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.
The absolute value of the latest wave -- The strength of the latest wave provides insight into the extremity of the market conditions.
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.
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.
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).
Time duration -- Lastly, the time duration between the two points of a divergence can also be an important factor. A divergence that spans over a longer period might indicate a more significant market sentiment shift.
💮 Tuning the GDM
--
The 6 components discussed above 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.
This makes this indicator very user-friendly. The only core parameter is the 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
--
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 -- hence a "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.
Another handy feature is a threshold to more strikingly visualise "strong" GDMs.
🌸 --- GOEMONYAE TRADING SYSTEM --- 🌸
As previously mentioned, this indicator is a 📡 Signal Provider, part of the suite of the GoemonYae Trading System (🤲 Community Edition). The greatest value comes from connecting multiple 📡 Signal Providers to the 🧬 Flux Composer to find confluence between signals. 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. On its turn, the Flux Composer can be connected to the GYTS "🎼 Order Orchestrator" for backtesting and trade automation.
Digitalsignal
[GYTS-CE] Signal Provider | WaveTrend 4D with QMCWaveTrend 4D with Quantile Median Crosses (Community 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 normalised and smooth signals with minimised lag.
The name "WaveTrend 4D" is derived from the usage of 4 dimensions, representing different frequencies or timeframes. Next to the "fast", "normal" and "slow" frequency, the fourth frequency is called "lethargic" (very slow). This gives the opportunity utilise more dimensions without having abundant signals, since we quantify and filter the quality of signals.
WT4D strives to help discriminating high-quality signals from the indicator by introducing the Gradient Divergence Measure (GDM) and Quantile Median Crosses (QMC). For simplicity, speed and focus, this particular indicator includes only the QMC part. Check the other 🤲Community Edition of this indicator that focuses on the GDM. For QMC, see below for more information.
🌸 --- QUANTILE MEDIAN CROSSES (QMC) --- 🌸
💮 Introduction
--
A powerful approach when working with WaveTrend is to use the frequencies' crossings of the median (zero) line. This would signify a continuation of the reversal. However, not all of those crossings would be trades with a high probability of success. For this reason, we strive to only consider reversals after the most strong trends start to show weakness. We call these reversals the "Quantile Median Crosses" (QMC), deriving the name from the used methodology.
💮 Methodology
--
To find these "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 frequency is crossing the median in a period of consolidation, the areas between those crosses would be small. But if there was a strong momentum, and the frequency 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 integrals 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".
💮 QMC on the Oscillator
--
The QMC is shown as a label "🔴" above the median or with "🟢" below the median. 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.
🌸 --- GOEMONYAE TRADING SYSTEM --- 🌸
As previously mentioned, this indicator is a 📡 Signal Provider, part of the suite of the GoemonYae Trading System (🤲 Community Edition). The greatest value comes from connecting multiple 📡 Signal Providers to the 🧬 Flux Composer to find confluence between signals. 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. On its turn, the Flux Composer can be connected to the GYTS "🎼 Order Orchestrator" for backtesting and trade automation.
[GYTS-Pro] Signal Provider | WaveTrend 4D with GDM + QMCWaveTrend 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) --- 🌸
💮 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:
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.
The absolute value of the latest wave -- The strength of the latest wave provides insight into the extremity of the market conditions.
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.
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.
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).
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) --- 🌸
💮 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:
( 🤲 🧰 🎩 ) 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.
( -- 🧰 🎩 ) Both GDM and QMC -- Only the Pro and Ult versions include both the GDM and QMC in one indicator
( 🤲 🧰 🎩 ) 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.
( 🤲 🧰 🎩 ) 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.
( 🤲 🧰 🎩 ) Support for HTF -- The indicator works on higher timeframes than the current chart and all parameters and calculations are scaled accordingly.
( __ 🧰 🎩 ) 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.
( __ __ 🎩 ) 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.
( __ 🧰 __ ) 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.
( __ __ 🎩 ) 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.
( __ __ 🎩 ) 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.
( 🤲 🧰 🎩 ) 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.
( __ 🧰 __ ) 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.
( __ __ 🎩 ) 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
( 🤲 🧰 🎩 ) WaveTrend 4D settings -- Possibility to adjust the core WaveTrend settings
( 🤲 🧰 🎩 ) 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.
WaveTrend 3D█ OVERVIEW
WaveTrend 3D (WT3D) is a novel implementation of the famous WaveTrend (WT) indicator and has been completely redesigned from the ground up to address some of the inherent shortcomings associated with the traditional WT algorithm.
█ BACKGROUND
The WaveTrend (WT) indicator has become a widely popular tool for traders in recent years. WT was first ported to PineScript in 2014 by the user @LazyBear, and since then, it has ascended to become one of the Top 5 most popular scripts on TradingView.
The WT algorithm appears to have origins in a lesser-known proprietary algorithm called Trading Channel Index (TCI), created by AIQ Systems in 1986 as an integral part of their commercial software suite, TradingExpert Pro. The software’s reference manual states that “TCI identifies changes in price direction” and is “an adaptation of Donald R. Lambert’s Commodity Channel Index (CCI)”, which was introduced to the world six years earlier in 1980. Interestingly, a vestige of this early beginning can still be seen in the source code of LazyBear’s script, where the final EMA calculation is stored in an intermediate variable called “tci” in the code.
█ IMPLEMENTATION DETAILS
WaveTrend 3D is an alternative implementation of WaveTrend that directly addresses some of the known shortcomings of the indicator, including its unbounded extremes, susceptibility to whipsaw, and lack of insight into other timeframes.
In the canonical WT approach, an exponential moving average (EMA) for a given lookback window is used to assess the variability between price and two other EMAs relative to a second lookback window. Since the difference between the average price and its associated EMA is essentially unbounded, an arbitrary scaling factor of 0.015 is typically applied as a crude form of rescaling but still fails to capture 20-30% of values between the range of -100 to 100. Additionally, the trigger signal for the final EMA (i.e., TCI) crossover-based oscillator is a four-bar simple moving average (SMA), which further contributes to the net lag accumulated by the consecutive EMA calculations in the previous steps.
The core idea behind WT3D is to replace the EMA-based crossover system with modern Digital Signal Processing techniques. By assuming that price action adheres approximately to a Gaussian distribution, it is possible to sidestep the scaling nightmare associated with unbounded price differentials of the original WaveTrend method by focusing instead on the alteration of the underlying Probability Distribution Function (PDF) of the input series. Furthermore, using a signal processing filter such as a Butterworth Filter, we can eliminate the need for consecutive exponential moving averages along with the associated lag they bring.
Ideally, it is convenient to have the resulting probability distribution oscillate between the values of -1 and 1, with the zero line serving as a median. With this objective in mind, it is possible to borrow a common technique from the field of Machine Learning that uses a sigmoid-like activation function to transform our data set of interest. One such function is the hyperbolic tangent function (tanh), which is often used as an activation function in the hidden layers of neural networks due to its unique property of ensuring the values stay between -1 and 1. By taking the first-order derivative of our input series and normalizing it using the quadratic mean, the tanh function performs a high-quality redistribution of the input signal into the desired range of -1 to 1. Finally, using a dual-pole filter such as the Butterworth Filter popularized by John Ehlers, excessive market noise can be filtered out, leaving behind a crisp moving average with minimal lag.
Furthermore, WT3D expands upon the original functionality of WT by providing:
First-class support for multi-timeframe (MTF) analysis
Kernel-based regression for trend reversal confirmation
Various options for signal smoothing and transformation
A unique mode for visualizing an input series as a symmetrical, three-dimensional waveform useful for pattern identification and cycle-related analysis
█ SETTINGS
This is a summary of the settings used in the script listed in roughly the order in which they appear. By default, all default colors are from Google's TensorFlow framework and are considered to be colorblind safe.
Source: The input series. Usually, it is the close or average price, but it can be any series.
Use Mirror: Whether to display a mirror image of the source series; for visualizing the series as a 3D waveform similar to a soundwave.
Use EMA: Whether to use an exponential moving average of the input series.
EMA Length: The length of the exponential moving average.
Use COG: Whether to use the center of gravity of the input series.
COG Length: The length of the center of gravity.
Speed to Emphasize: The target speed to emphasize.
Width: The width of the emphasized line.
Display Kernel Moving Average: Whether to display the kernel moving average of the signal. Like PCA, an unsupervised Machine Learning technique whereby neighboring vectors are projected onto the Principal Component.
Display Kernel Signal: Whether to display the kernel estimator for the emphasized line. Like the Kernel MA, it can show underlying shifts in bias within a more significant trend by the colors reflected on the ribbon itself.
Show Oscillator Lines: Whether to show the oscillator lines.
Offset: The offset of the emphasized oscillator plots.
Fast Length: The length scale factor for the fast oscillator.
Fast Smoothing: The smoothing scale factor for the fast oscillator.
Normal Length: The length scale factor for the normal oscillator.
Normal Smoothing: The smoothing scale factor for the normal frequency.
Slow Length: The length scale factor for the slow oscillator.
Slow Smoothing: The smoothing scale factor for the slow frequency.
Divergence Threshold: The number of bars for the divergence to be considered significant.
Trigger Wave Percent Size: How big the current wave should be relative to the previous wave.
Background Area Transparency Factor: Transparency factor for the background area.
Foreground Area Transparency Factor: Transparency factor for the foreground area.
Background Line Transparency Factor: Transparency factor for the background line.
Foreground Line Transparency Factor: Transparency factor for the foreground line.
Custom Transparency: Transparency of the custom colors.
Total Gradient Steps: The maximum amount of steps supported for a gradient calculation is 256.
Fast Bullish Color: The color of the fast bullish line.
Normal Bullish Color: The color of the normal bullish line.
Slow Bullish Color: The color of the slow bullish line.
Fast Bearish Color: The color of the fast bearish line.
Normal Bearish Color: The color of the normal bearish line.
Slow Bearish Color: The color of the slow bearish line.
Bullish Divergence Signals: The color of the bullish divergence signals.
Bearish Divergence Signals: The color of the bearish divergence signals.
█ ACKNOWLEDGEMENTS
@LazyBear - For authoring the original WaveTrend port on TradingView
@PineCoders - For the beautiful color gradient framework used in this indicator
@veryfid - For the inspiration of using mirrored signals for cycle analysis and using multiple lookback windows as proxies for other timeframes
loxxfsrrdspfiltsLibrary "loxxfsrrdspfilts"
loxxfsrrdspfilts : FATL, SATL, RFTL, & RSTL Digital Signal Filters
fatl(src)
fatl
Parameters:
src : float
Returns: result float
rftl(src)
rftl
Parameters:
src : float
Returns: result float
satl(src)
satl
Parameters:
src : float
Returns: result float
rstl(src)
rstl
Parameters:
src : float
Returns: result float
FFTLibraryLibrary "FFTLibrary" contains a function for performing Fast Fourier Transform (FFT) along with a few helper functions. In general, FFT is defined for complex inputs and outputs. The real and imaginary parts of formally complex data are treated as separate arrays (denoted as x and y). For real-valued data, the array of imaginary parts should be filled with zeros.
FFT function
fft(x, y, dir) : Computes the one-dimensional discrete Fourier transform using an in-place complex-to-complex FFT algorithm . Note: The transform also produces a mirror copy of the frequency components, which correspond to the signal's negative frequencies.
Parameters:
x : float array, real part of the data, array size must be a power of 2
y : float array, imaginary part of the data, array size must be the same as x ; for real-valued input, y must be an array of zeros
dir : string, options = , defines the direction of the transform: forward" (time-to-frequency) or inverse (frequency-to-time)
Returns: x, y : tuple (float array, float array), real and imaginary parts of the transformed data (original x and y are changed on output)
Helper functions
fftPower(x, y) : Helper function that computes the power of each frequency component (in other words, Fourier amplitudes squared).
Parameters:
x : float array, real part of the Fourier amplitudes
y : float array, imaginary part of the Fourier amplitudes
Returns: power : float array of the same length as x and y , Fourier amplitudes squared
fftFreq(N) : Helper function that returns the FFT sample frequencies defined in cycles per timeframe unit. For example, if the timeframe is 5m, the frequencies are in cycles/(5 minutes).
Parameters:
N : int, window length (number of points in the transformed dataset)
Returns: freq : float array of N, contains the sample frequencies (with zero at the start).
[pp] Signal GeneratorResearch and Development Tool.
For anyone who is familiar with working with digital signals (audio/electrical engineers) you might appreciate this Signal Generator.
You can select and vary 4 different types of signals.
Logistic Map
If you're not familiar with the logistic map, then go watch a youtube video. By default the equation is meant to represent chaos and is a good alternative for random number generation.
Random
This uses the built-in random number generator. I'm not sure if it's better to use this or the logmap default settings. Either way, you have a choice.
Unit Impulse
Good for creating a transient impulse.
Step Impulse
Similar to the unit impulse. Except constant and not a transient.
Synthesizer
It comes with 4 wave functions (Sine, Triangle, Square, Saw) that can be combined for additive synthesis. Each wave function contains its own respective phase and amplitude control.
Credits
Many of these functions were taken from www.pinecoders.com with the exception of the logistic map. I simply aggregated them all into this toolkit for ease of use.
How to use
This is not a trading indicator. This is meant to be used for research and development. You could use it to test strategies, by generating white noise with the logmap and creating trading signals. Or you could use it for teaching and learning. Using the constant data as a dependable, repeatable resource.
[e2] Fourier series Model Of The MarketFourier series Model Of The Market
John F. Ehlers
TASC Jun 2019