PA-Adaptive MACD w/ Variety Levels [Loxx]PA-Adaptive MACD w/ Variety Levels is a Phase Accumulation Adaptive MACD with both floating and quantile levels. This is tuned for Forex. You'll have to adjust the Phase Accumulation Cycle settings to work for crypto and stock markets.
What is MACD?
Moving average convergence divergence ( MACD ) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period exponential moving average ( EMA ) from the 12-period EMA .
What is the Phase Accumulation Cycle?
The phase accumulation method of computing the dominant cycle is perhaps the easiest to comprehend. In this technique, we measure the phase at each sample by taking the arctangent of the ratio of the quadrature component to the in-phase component. A delta phase is generated by taking the difference of the phase between successive samples. At each sample we can then look backwards, adding up the delta phases.When the sum of the delta phases reaches 360 degrees, we must have passed through one full cycle, on average.The process is repeated for each new sample.
The phase accumulation method of cycle measurement always uses one full cycle’s worth of historical data.This is both an advantage and a disadvantage.The advantage is the lag in obtaining the answer scales directly with the cycle period.That is, the measurement of a short cycle period has less lag than the measurement of a longer cycle period. However, the number of samples used in making the measurement means the averaging period is variable with cycle period. longer averaging reduces the noise level compared to the signal.Therefore, shorter cycle periods necessarily have a higher out- put signal-to-noise ratio.
Included:
Zero-line and signal cross options for bar coloring, signals, and alerts
Alerts
Signals
Loxx's Expanded Source Types
4 moving average types
Quantiles
STD-Stepped, CFB-Adaptive Jurik Filter w/ Variety Levels [Loxx]STD-Stepped, CFB-Adaptive Jurik Filter w/ Variety Levels is a Composite Fractal Behavior, single/double Jurik filter with floating boundary levels, alerts, and signals.
What is Composite Fractal Behavior ( CFB )?
All around you mechanisms adjust themselves to their environment. From simple thermostats that react to air temperature to computer chips in modern cars that respond to changes in engine temperature, r.p.m.'s, torque, and throttle position. It was only a matter of time before fast desktop computers applied the mathematics of self-adjustment to systems that trade the financial markets.
Unlike basic systems with fixed formulas, an adaptive system adjusts its own equations. For example, start with a basic channel breakout system that uses the highest closing price of the last N bars as a threshold for detecting breakouts on the up side. An adaptive and improved version of this system would adjust N according to market conditions, such as momentum, price volatility or acceleration.
Since many systems are based directly or indirectly on cycles, another useful measure of market condition is the periodic length of a price chart's dominant cycle, (DC), that cycle with the greatest influence on price action.
The utility of this new DC measure was noted by author Murray Ruggiero in the January '96 issue of Futures Magazine. In it. Mr. Ruggiero used it to adaptive adjust the value of N in a channel breakout system. He then simulated trading 15 years of D-Mark futures in order to compare its performance to a similar system that had a fixed optimal value of N. The adaptive version produced 20% more profit!
This DC index utilized the popular MESA algorithm (a formulation by John Ehlers adapted from Burg's maximum entropy algorithm, MEM). Unfortunately, the DC approach is problematic when the market has no real dominant cycle momentum, because the mathematics will produce a value whether or not one actually exists! Therefore, we developed a proprietary indicator that does not presuppose the presence of market cycles. It's called CFB (Composite Fractal Behavior) and it works well whether or not the market is cyclic.
CFB examines price action for a particular fractal pattern, categorizes them by size, and then outputs a composite fractal size index. This index is smooth, timely and accurate
Essentially, CFB reveals the length of the market's trending action time frame. Long trending activity produces a large CFB index and short choppy action produces a small index value. Investors have found many applications for CFB which involve scaling other existing technical indicators adaptively, on a bar-to-bar basis.
What is Jurik Volty used in the Juirk Filter?
One of the lesser known qualities of Juirk smoothing is that the Jurik smoothing process is adaptive. "Jurik Volty" (a sort of market volatility ) is what makes Jurik smoothing adaptive. The Jurik Volty calculation can be used as both a standalone indicator and to smooth other indicators that you wish to make adaptive.
What is the Jurik Moving Average?
Have you noticed how moving averages add some lag (delay) to your signals? ... especially when price gaps up or down in a big move, and you are waiting for your moving average to catch up? Wait no more! JMA eliminates this problem forever and gives you the best of both worlds: low lag and smooth lines.
Ideally, you would like a filtered signal to be both smooth and lag-free. Lag causes delays in your trades, and increasing lag in your indicators typically result in lower profits. In other words, late comers get what's left on the table after the feast has already begun.
Included:
-Color bars
-Color background
-Color trend
-Color deadzones
-Show signals
-Long/short alerts
-ATR and quantile based levels
Weighted Harrell-Davis Quantile Estimator with AbsoluteDeviation
QUANTILE ESTIMATORS
Weighted Harrell-Davis Quantile Estimator with Absolute Deviation Fences.
DISCLAIMER:
The Following indicator/code IS NOT intended to be a formal investment advice or recommendation by the author, nor should be construed as such. Users will be fully responsible by their use regarding their own trading vehicles/assets.
The following indicator was made for NON LUCRATIVE ACTIVITIES and must remain as is, following TradingView's regulations. Use of indicator and their code are published for work and knowledge sharing. All access granted over it, their use, copy or re-use should mention authorship(s) and origin(s).
WARNING NOTICE!
THE INCLUDED FUNCTION MUST BE CONSIDERED FOR TESTING. The models included in the indicator have been taken from open sources on the web and some of them has been modified by the author, problems could occur at diverse data sceneries, compiler version, or any other externality.
Purpose:
Weighted Quantiles or <> are quite difficult to find on must systems, also it's non-weighted approach are rarely used to estimate the location parameter of price distribution WICH IS NOT NORMAL, all this in favour of it's non-robust counterpart, the Arithmetic rolling Mean or <> and it's weighted variants like the WMA, VWAP, etc.
Also, a big drawback from this is that must statistics derived from Normal-Distribution parameter location (the Mean) definitely will not fit for an efficient, nor robust estimation for price distributions, so their moments like the standard deviation, kurtosis, skewness, etc. will not be the better tools to build derived algorithms or technical indicators among price/volume.
In an effort searching better statistical tools for price distributions, I found the excellent work of Andrey Akinshin that took me to port some of their Math research contributions for the compute benchmarking field , and bring it here at the TradingView ecosystem to take a shot at the price distribution crazy fields. For a better detail of what the weighted Harrell-Davis Quantile Estimator can do, who better than drink directly from the source at References:
References:
Weighted Quantile Estimators.
DoubleMAD outlier detector based on the Harrell-Davis quantile estimator.
Unbiased median absolute deviation based on the Harrell-Davis quantile estimator.
Quantile confidence intervals for weighted samples.
Licensing:
This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International Copyright (c) 2021 (CC BY-NC-SA 4.0)
Copyright's & Mentions:
The Gamma Functions & Beta Probability Density Functions C# implementations by the Math.NET Numerics, part of the Math.NET Project.
The Regularized Incomplete (Left) Beta Function C# implementation by the SAMTools, htslib project.
The Weighted Harrell-Davis Quantile estimator ; C# & R implementations by Andrey Akinshin.
External PineScript code, methods, support & consultancy by @PineCoders staff with special mention for:
+ "ma sorter ('sort by array' example)- JD" by @Duyck.
+ Porting, mods, compilation and debugging for this script by @XeL_Arjona for the TradingView's @PineCoders community.