GKD-C Lyapunov Hodrick-Prescott Oscillator w/ DSL [Loxx]Giga Kaleidoscope GKD-C Lyapunov Hodrick-Prescott Oscillator w/ DSL is a Confirmation module included in Loxx's "Giga Kaleidoscope Modularized Trading System".
█ Giga Kaleidoscope Modularized Trading System
What is Loxx's "Giga Kaleidoscope Modularized Trading System"?
The Giga Kaleidoscope Modularized Trading System is a trading system built on the philosophy of the NNFX (No Nonsense Forex) algorithmic trading.
What is the NNFX algorithmic trading strategy?
The NNFX (No-Nonsense Forex) trading system is a comprehensive approach to Forex trading that is designed to simplify the process and remove the confusion and complexity that often surrounds trading. The system was developed by a Forex trader who goes by the pseudonym "VP" and has gained a significant following in the Forex community.
The NNFX trading system is based on a set of rules and guidelines that help traders make objective and informed decisions. These rules cover all aspects of trading, including market analysis, trade entry, stop loss placement, and trade management.
Here are the main components of the NNFX trading system:
1. Trading Philosophy: The NNFX trading system is based on the idea that successful trading requires a comprehensive understanding of the market, objective analysis, and strict risk management. The system aims to remove subjective elements from trading and focuses on objective rules and guidelines.
2. Technical Analysis: The NNFX trading system relies heavily on technical analysis and uses a range of indicators to identify high-probability trading opportunities. The system uses a combination of trend-following and mean-reverting strategies to identify trades.
3. Market Structure: The NNFX trading system emphasizes the importance of understanding the market structure, including price action, support and resistance levels, and market cycles. The system uses a range of tools to identify the market structure, including trend lines, channels, and moving averages.
4. Trade Entry: The NNFX trading system has strict rules for trade entry. The system uses a combination of technical indicators to identify high-probability trades, and traders must meet specific criteria to enter a trade.
5. Stop Loss Placement: The NNFX trading system places a significant emphasis on risk management and requires traders to place a stop loss order on every trade. The system uses a combination of technical analysis and market structure to determine the appropriate stop loss level.
6. Trade Management: The NNFX trading system has specific rules for managing open trades. The system aims to minimize risk and maximize profit by using a combination of trailing stops, take profit levels, and position sizing.
Overall, the NNFX trading system is designed to be a straightforward and easy-to-follow approach to Forex trading that can be applied by traders of all skill levels.
Core components of an NNFX algorithmic trading strategy
The NNFX algorithm is built on the principles of trend, momentum, and volatility. There are six core components in the NNFX trading algorithm:
1. Volatility - price volatility; e.g., Average True Range, True Range Double, Close-to-Close, etc.
2. Baseline - a moving average to identify price trend
3. Confirmation 1 - a technical indicator used to identify trends
4. Confirmation 2 - a technical indicator used to identify trends
5. Continuation - a technical indicator used to identify trends
6. Volatility/Volume - a technical indicator used to identify volatility/volume breakouts/breakdown
7. Exit - a technical indicator used to determine when a trend is exhausted
What is Volatility in the NNFX trading system?
In the NNFX (No Nonsense Forex) trading system, ATR (Average True Range) is typically used to measure the volatility of an asset. It is used as a part of the system to help determine the appropriate stop loss and take profit levels for a trade. ATR is calculated by taking the average of the true range values over a specified period.
True range is calculated as the maximum of the following values:
-Current high minus the current low
-Absolute value of the current high minus the previous close
-Absolute value of the current low minus the previous close
ATR is a dynamic indicator that changes with changes in volatility. As volatility increases, the value of ATR increases, and as volatility decreases, the value of ATR decreases. By using ATR in NNFX system, traders can adjust their stop loss and take profit levels according to the volatility of the asset being traded. This helps to ensure that the trade is given enough room to move, while also minimizing potential losses.
Other types of volatility include True Range Double (TRD), Close-to-Close, and Garman-Klass
What is a Baseline indicator?
The baseline is essentially a moving average, and is used to determine the overall direction of the market.
The baseline in the NNFX system is used to filter out trades that are not in line with the long-term trend of the market. The baseline is plotted on the chart along with other indicators, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR).
Trades are only taken when the price is in the same direction as the baseline. For example, if the baseline is sloping upwards, only long trades are taken, and if the baseline is sloping downwards, only short trades are taken. This approach helps to ensure that trades are in line with the overall trend of the market, and reduces the risk of entering trades that are likely to fail.
By using a baseline in the NNFX system, traders can have a clear reference point for determining the overall trend of the market, and can make more informed trading decisions. The baseline helps to filter out noise and false signals, and ensures that trades are taken in the direction of the long-term trend.
What is a Confirmation indicator?
Confirmation indicators are technical indicators that are used to confirm the signals generated by primary indicators. Primary indicators are the core indicators used in the NNFX system, such as the Average True Range (ATR), the Moving Average (MA), and the Relative Strength Index (RSI).
The purpose of the confirmation indicators is to reduce false signals and improve the accuracy of the trading system. They are designed to confirm the signals generated by the primary indicators by providing additional information about the strength and direction of the trend.
Some examples of confirmation indicators that may be used in the NNFX system include the Bollinger Bands, the MACD (Moving Average Convergence Divergence), and the Stochastic Oscillator. These indicators can provide information about the volatility, momentum, and trend strength of the market, and can be used to confirm the signals generated by the primary indicators.
In the NNFX system, confirmation indicators are used in combination with primary indicators and other filters to create a trading system that is robust and reliable. By using multiple indicators to confirm trading signals, the system aims to reduce the risk of false signals and improve the overall profitability of the trades.
What is a Continuation indicator?
In the NNFX (No Nonsense Forex) trading system, a continuation indicator is a technical indicator that is used to confirm a current trend and predict that the trend is likely to continue in the same direction. A continuation indicator is typically used in conjunction with other indicators in the system, such as a baseline indicator, to provide a comprehensive trading strategy.
What is a Volatility/Volume indicator?
Volume indicators, such as the On Balance Volume (OBV), the Chaikin Money Flow (CMF), or the Volume Price Trend (VPT), are used to measure the amount of buying and selling activity in a market. They are based on the trading volume of the market, and can provide information about the strength of the trend. In the NNFX system, volume indicators are used to confirm trading signals generated by the Moving Average and the Relative Strength Index. Volatility indicators include Average Direction Index, Waddah Attar, and Volatility Ratio. In the NNFX trading system, volatility is a proxy for volume and vice versa.
By using volume indicators as confirmation tools, the NNFX trading system aims to reduce the risk of false signals and improve the overall profitability of trades. These indicators can provide additional information about the market that is not captured by the primary indicators, and can help traders to make more informed trading decisions. In addition, volume indicators can be used to identify potential changes in market trends and to confirm the strength of price movements.
What is an Exit indicator?
The exit indicator is used in conjunction with other indicators in the system, such as the Moving Average (MA), the Relative Strength Index (RSI), and the Average True Range (ATR), to provide a comprehensive trading strategy.
The exit indicator in the NNFX system can be any technical indicator that is deemed effective at identifying optimal exit points. Examples of exit indicators that are commonly used include the Parabolic SAR, the Average Directional Index (ADX), and the Chandelier Exit.
The purpose of the exit indicator is to identify when a trend is likely to reverse or when the market conditions have changed, signaling the need to exit a trade. By using an exit indicator, traders can manage their risk and prevent significant losses.
In the NNFX system, the exit indicator is used in conjunction with a stop loss and a take profit order to maximize profits and minimize losses. The stop loss order is used to limit the amount of loss that can be incurred if the trade goes against the trader, while the take profit order is used to lock in profits when the trade is moving in the trader's favor.
Overall, the use of an exit indicator in the NNFX trading system is an important component of a comprehensive trading strategy. It allows traders to manage their risk effectively and improve the profitability of their trades by exiting at the right time.
How does Loxx's GKD (Giga Kaleidoscope Modularized Trading System) implement the NNFX algorithm outlined above?
Loxx's GKD v1.0 system has five types of modules (indicators/strategies). These modules are:
1. GKD-BT - Backtesting module (Volatility, Number 1 in the NNFX algorithm)
2. GKD-B - Baseline module (Baseline and Volatility/Volume, Numbers 1 and 2 in the NNFX algorithm)
3. GKD-C - Confirmation 1/2 and Continuation module (Confirmation 1/2 and Continuation, Numbers 3, 4, and 5 in the NNFX algorithm)
4. GKD-V - Volatility/Volume module (Confirmation 1/2, Number 6 in the NNFX algorithm)
5. GKD-E - Exit module (Exit, Number 7 in the NNFX algorithm)
(additional module types will added in future releases)
Each module interacts with every module by passing data between modules. Data is passed between each module as described below:
GKD-B => GKD-V => GKD-C(1) => GKD-C(2) => GKD-C(Continuation) => GKD-E => GKD-BT
That is, the Baseline indicator passes its data to Volatility/Volume. The Volatility/Volume indicator passes its values to the Confirmation 1 indicator. The Confirmation 1 indicator passes its values to the Confirmation 2 indicator. The Confirmation 2 indicator passes its values to the Continuation indicator. The Continuation indicator passes its values to the Exit indicator, and finally, the Exit indicator passes its values to the Backtest strategy.
This chaining of indicators requires that each module conform to Loxx's GKD protocol, therefore allowing for the testing of every possible combination of technical indicators that make up the six components of the NNFX algorithm.
What does the application of the GKD trading system look like?
Example trading system:
Backtest: Strategy with 1-3 take profits, trailing stop loss, multiple types of PnL volatility, and 2 backtesting styles
Baseline: Hull Moving Average
Volatility/Volume: Hurst Exponent
Confirmation 1: Lyapunov Hodrick-Prescott Oscillator w/ DSL as shown on the chart above
Confirmation 2: Williams Percent Range
Continuation: Fisher Transform
Exit: Rex Oscillator
Each GKD indicator is denoted with a module identifier of either: GKD-BT, GKD-B, GKD-C, GKD-V, or GKD-E. This allows traders to understand to which module each indicator belongs and where each indicator fits into the GKD protocol chain.
Giga Kaleidoscope Modularized Trading System Signals (based on the NNFX algorithm)
Standard Entry
1. GKD-C Confirmation 1 Signal
2. GKD-B Baseline agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
Baseline Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
6. GKD-C Confirmation 1 signal was less than 7 candles prior
Continuation Entry
1. Standard Entry, Baseline Entry, or Pullback; entry triggered previously
2. GKD-B Baseline hasn't crossed since entry signal trigger
3. GKD-C Confirmation Continuation Indicator signals
4. GKD-C Confirmation 1 agrees
5. GKD-B Baseline agrees
6. GKD-C Confirmation 2 agrees
1-Candle Rule Standard Entry
1. GKD-C Confirmation 1 signal
2. GKD-B Baseline agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
Next Candle:
1. Price retraced (Long: close < close or Short: close > close )
2. GKD-B Baseline agrees
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume agrees
1-Candle Rule Baseline Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
4. GKD-C Confirmation 1 signal was less than 7 candles prior
Next Candle:
1. Price retraced (Long: close < close or Short: close > close )
2. GKD-B Baseline agrees
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume Agrees
PullBack Entry
1. GKD-B Baseline signal
2. GKD-C Confirmation 1 agrees
3. Price is beyond 1.0x Volatility of Baseline
Next Candle:
1. Price is within a range of 0.2x Volatility and 1.0x Volatility of the Goldie Locks Mean
3. GKD-C Confirmation 1 agrees
4. GKD-C Confirmation 2 agrees
5. GKD-V Volatility/Volume Agrees
█ GKD-C Lyapunov Hodrick-Prescott Oscillator w/ DSL
What is Hodrick–Prescott filter?
The Hodrick-Prescott (HP) filter is a mathematical tool used in macroeconomics to separate a time series into its trend component and its cyclical component. It was developed by economists Robert Hodrick and Edward Prescott in 1980.
The HP filter works by decomposing a time series into two components: a trend component and a cyclical component. The trend component represents the long-term behavior of the time series, while the cyclical component represents the short-term fluctuations around the trend.
The HP filter is based on the assumption that the trend component of a time series varies smoothly over time, while the cyclical component varies more rapidly. The filter uses a mathematical algorithm to estimate the trend component of the time series, and then subtracts the trend from the original time series to obtain the cyclical component.
The HP filter is widely used in macroeconomics to analyze business cycles, as it allows researchers to separate the underlying trend in economic data from the short-term fluctuations. It is also used in finance to analyze asset prices, and in other fields where time series analysis is important.
What is Lyapunov stability?
Lyapunov stability is a concept in control theory and dynamical systems theory that concerns the stability of a system or a point in the system's state space. Specifically, it is a method for analyzing the behavior of nonlinear systems in terms of their asymptotic stability.
The basic idea behind Lyapunov stability is to consider a function, called a Lyapunov function, that measures the distance between the system's current state and some reference state, and then use this function to determine whether the system is stable or unstable. In particular, a system is said to be Lyapunov stable if, for any initial condition within some region around the reference state, the system's trajectory will eventually converge to the reference state as time goes to infinity.
A Lyapunov function must satisfy certain conditions to be useful for analyzing stability, such as being positive definite and decreasing along the trajectories of the system. Lyapunov stability is often used to analyze the stability of equilibrium points, which are states where the system's behavior does not change over time.
Chaos theory is a branch of mathematics that studies the behavior of dynamic systems that are highly sensitive to initial conditions. It is used to study systems that exhibit complex and seemingly random behavior over time. Chaos theory is closely related to the study of nonlinear dynamical systems, which are systems that do not exhibit the linearity property, which means that their behavior is not proportional to their inputs.
One of the key tools of chaos theory is the Lyapunov exponent, which is a measure of the rate at which nearby trajectories in a dynamic system diverge over time. In chaotic systems, the Lyapunov exponent is positive, indicating that small differences in initial conditions lead to exponentially divergent trajectories over time.
Chaos theory has applications in a wide range of fields, including physics, engineering, biology, economics, and finance. It provides a powerful tool for understanding the behavior of complex systems, and is often used to model the behavior of natural systems such as weather patterns, fluid dynamics, and ecological systems.
What are DSL Discontinued Signal Line?
A lot of indicators are using signal lines in order to determine the trend (or some desired state of the indicator) easier. The idea of the signal line is easy : comparing the value to it's smoothed (slightly lagging) state, the idea of current momentum/state is made.
Discontinued signal line is inheriting that simple signal line idea and it is extending it : instead of having one signal line, more lines depending on the current value of the indicator.
"Signal" line is calculated the following way :
When a certain level is crossed into the desired direction, the EMA of that value is calculated for the desired signal line
When that level is crossed into the opposite direction, the previous "signal" line value is simply "inherited" and it becomes a kind of a level
This way it becomes a combination of signal lines and levels that are trying to combine both the good from both methods.
In simple terms, DSL uses the concept of a signal line and betters it by inheriting the previous signal line's value & makes it a level.
What is Lyapunov Hodrick-Prescott Oscillator w/ DSL?
Lyapunov Hodrick-Prescott Oscillator w/ DSL is a Hodrick-Prescott Channel Filter that is modified using the Lyapunov stability algorithm to turn the filter into an oscillator. Signals are created using Discontinued Signal Lines or Zero-line crosses.
Requirements
Inputs
Confirmation 1 and Solo Confirmation: GKD-V Volatility / Volume indicator
Confirmation 2: GKD-C Confirmation indicator
Outputs
Confirmation 2 and Solo Confirmation Complex: GKD-E Exit indicator
Confirmation 1: GKD-C Confirmation indicator
Continuation: GKD-E Exit indicator
Solo Confirmation Simple: GKD-BT Backtest strategy
Additional features will be added in future releases.
Lyapunov
Lyapunov Hodrick-Prescott Oscillator w/ DSL [Loxx]Lyapunov Hodrick-Prescott Oscillator w/ DSL is a Hodrick-Prescott Channel Filter that is modified using the Lyapunov stability algorithm to turn the filter into an oscillator. Signals are created using Discontinued Signal Lines.
What is the Lyapunov Stability?
As soon as scientists realized that the evolution of physical systems can be described in terms of mathematical equations, the stability of the various dynamical regimes was recognized as a matter of primary importance. The interest for this question was not only motivated by general curiosity, but also by the need to know, in the XIX century, to what extent the behavior of suitable mechanical devices remains unchanged, once their configuration has been perturbed. As a result, illustrious scientists such as Lagrange, Poisson, Maxwell and others deeply thought about ways of quantifying the stability both in general and specific contexts. The first exact definition of stability was given by the Russian mathematician Aleksandr Lyapunov who addressed the problem in his PhD Thesis in 1892, where he introduced two methods, the first of which is based on the linearization of the equations of motion and has originated what has later been termed Lyapunov exponents (LE). (Lyapunov 1992)
The interest in it suddenly skyrocketed during the Cold War period when the so-called "Second Method of Lyapunov" (see below) was found to be applicable to the stability of aerospace guidance systems which typically contain strong nonlinearities not treatable by other methods. A large number of publications appeared then and since in the control and systems literature. More recently the concept of the Lyapunov exponent (related to Lyapunov's First Method of discussing stability) has received wide interest in connection with chaos theory . Lyapunov stability methods have also been applied to finding equilibrium solutions in traffic assignment problems.
In practice, Lyapunov exponents can be computed by exploiting the natural tendency of an n-dimensional volume to align along the n most expanding subspace. From the expansion rate of an n-dimensional volume, one obtains the sum of the n largest Lyapunov exponents. Altogether, the procedure requires evolving n linearly independent perturbations and one is faced with the problem that all vectors tend to align along the same direction. However, as shown in the late '70s, this numerical instability can be counterbalanced by orthonormalizing the vectors with the help of the Gram-Schmidt procedure (Benettin et al. 1980, Shimada and Nagashima 1979) (or, equivalently with a QR decomposition). As a result, the LE λi, naturally ordered from the largest to the most negative one, can be computed: they are altogether referred to as the Lyapunov spectrum.
The Lyapunov exponent "λ" , is useful for distinguishing among the various types of orbits. It works for discrete as well as continuous systems.
λ < 0
The orbit attracts to a stable fixed point or stable periodic orbit. Negative Lyapunov exponents are characteristic of dissipative or non-conservative systems (the damped harmonic oscillator for instance). Such systems exhibit asymptotic stability; the more negative the exponent, the greater the stability. Superstable fixed points and superstable periodic points have a Lyapunov exponent of λ = −∞. This is something akin to a critically damped oscillator in that the system heads towards its equilibrium point as quickly as possible.
λ = 0
The orbit is a neutral fixed point (or an eventually fixed point). A Lyapunov exponent of zero indicates that the system is in some sort of steady state mode. A physical system with this exponent is conservative. Such systems exhibit Lyapunov stability. Take the case of two identical simple harmonic oscillators with different amplitudes. Because the frequency is independent of the amplitude, a phase portrait of the two oscillators would be a pair of concentric circles. The orbits in this situation would maintain a constant separation, like two flecks of dust fixed in place on a rotating record.
λ > 0
The orbit is unstable and chaotic. Nearby points, no matter how close, will diverge to any arbitrary separation. All neighborhoods in the phase space will eventually be visited. These points are said to be unstable. For a discrete system, the orbits will look like snow on a television set. This does not preclude any organization as a pattern may emerge. Thus the snow may be a bit lumpy. For a continuous system, the phase space would be a tangled sea of wavy lines like a pot of spaghetti. A physical example can be found in Brownian motion. Although the system is deterministic, there is no order to the orbit that ensues.
For our purposes here, we transform the HP by applying Lyapunov Stability as follows:
output = math.log(math.abs(HP / HP ))
You can read more about Lyapunov Stability here: Measuring Chaos
What is. the Hodrick-Prescott Filter?
The Hodrick-Prescott (HP) filter refers to a data-smoothing technique. The HP filter is commonly applied during analysis to remove short-term fluctuations associated with the business cycle. Removal of these short-term fluctuations reveals long-term trends.
The Hodrick-Prescott (HP) filter is a tool commonly used in macroeconomics. It is named after economists Robert Hodrick and Edward Prescott who first popularized this filter in economics in the 1990s. Hodrick was an economist who specialized in international finance. Prescott won the Nobel Memorial Prize, sharing it with another economist for their research in macroeconomics.
This filter determines the long-term trend of a time series by discounting the importance of short-term price fluctuations. In practice, the filter is used to smooth and detrend the Conference Board's Help Wanted Index (HWI) so it can be benchmarked against the Bureau of Labor Statistic's (BLS) JOLTS, an economic data series that may more accurately measure job vacancies in the U.S.
The HP filter is one of the most widely used tools in macroeconomic analysis. It tends to have favorable results if the noise is distributed normally, and when the analysis being conducted is historical.
What are DSL Discontinued Signal Line?
A lot of indicators are using signal lines in order to determine the trend (or some desired state of the indicator) easier. The idea of the signal line is easy : comparing the value to it's smoothed (slightly lagging) state, the idea of current momentum/state is made.
Discontinued signal line is inheriting that simple signal line idea and it is extending it : instead of having one signal line, more lines depending on the current value of the indicator.
"Signal" line is calculated the following way :
When a certain level is crossed into the desired direction, the EMA of that value is calculated for the desired signal line
When that level is crossed into the opposite direction, the previous "signal" line value is simply "inherited" and it becomes a kind of a level
This way it becomes a combination of signal lines and levels that are trying to combine both the good from both methods.
In simple terms, DSL uses the concept of a signal line and betters it by inheriting the previous signal line's value & makes it a level.
Included:
Bar coloring
Alerts
Signals
Loxx's Expanded Source Types