Kaufman Adaptive Moving Average (KAMA) Strategy [TradeDots]"The Kaufman Adaptive Moving Average (KAMA) Strategy" is a trend-following system that leverages the adaptive qualities of the Kaufman Adaptive Moving Average (KAMA). This strategy is distinguished by its ability to adjust dynamically to market volatility, enhancing trading accuracy by minimizing the effects of false and delayed signals often associated with the Simple Moving Average (SMA).
HOW IT WORKS
This strategy is centered around use of the Kaufman Adaptive Moving Average (KAMA) indicator, which refines the principles of the Exponential Moving Average (EMA) with a superior smoothing technique.
KAMA distinguishes itself by its responsiveness to changes in market prices through an "Efficiency Ratio (ER)." This ratio is computed by dividing the recent absolute net price change by the cumulative sum of the absolute price changes over a specified period. The resulting ER value ranges between 0 and 1, where 0 indicates high market noise and 1 reflects stronger market momentum.
Using ER, we could get the smoothing constant (SC) for the moving average derived using the following formula:
fastest = 2/(fastma_length + 1)
slowest = 2/(slowma_length + 1)
SC = math.pow((ER * (fastest-slowest) + slowest), 2)
The KAMA line is then calculated by applying the SC to the difference between the current price and the previous KAMA.
APPLICATION
For entering long positions, this strategy initializes when there is a sequence of 10 consecutive rising KAMA lines. Conversely, a sequence of 10 consecutive falling KAMA lines triggers sell orders for long positions. The same logic applies inversely for short positions.
DEFAULT SETUP
Commission: 0.01%
Initial Capital: $10,000
Equity per Trade: 80%
Users are advised to adjust and personalize this trading strategy to better match their individual trading preferences and style.
RISK DISCLAIMER
Trading entails substantial risk, and most day traders incur losses. All content, tools, scripts, articles, and education provided by TradeDots serve purely informational and educational purposes. Past performances are not definitive predictors of future results.
自適應移動均線(AMA)
Adaptive Moving Average (AMA) Signals (Zeiierman)█ Overview
The Adaptive Moving Average (AMA) Signals indicator, enhances the classic concept of moving averages by making them adaptive to the market's volatility. This adaptability makes the AMA particularly useful in identifying market trends with varying degrees of volatility.
The core of the AMA's adaptability lies in its Efficiency Ratio (ER), which measures the directionality of the market over a given period. The ER is calculated by dividing the absolute change in price over a period by the sum of the absolute differences in daily prices over the same period.
⚪ Why It's Useful
The AMA Signals indicator is particularly useful because of its adaptability to changing market conditions. Unlike static moving averages, it dynamically adjusts, providing more relevant signals that can help traders capture trends earlier or identify reversals with greater accuracy. Its configurability makes it suitable for various trading strategies and timeframes, from day trading to swing trading.
█ How It Works
The AMA Signals indicator operates on the principle of adapting to market efficiency through the calculation of the Efficiency Ratio (ER), which measures the directionality of the market over a specified period. By comparing the net price change to total price movements, the AMA adjusts its sensitivity, becoming faster during trending markets and slower during sideways markets. This adaptability is enhanced by a gamma parameter that filters signals for either trend continuation or reversal, making it versatile across different market conditions.
change = math.abs(close - close )
volatility = math.sum(math.abs(close - close ), n)
ER = change / volatility
Efficiency Ratio (ER) Calculation: The AMA begins with the computation of the Efficiency Ratio (ER), which measures the market's directionality over a specified period. The ER is a ratio of the net price change to the total price movements, serving as a measure of the efficiency of price movements.
Adaptive Smoothing: Based on the ER, the indicator calculates the smoothing constants for the fastest and slowest Exponential Moving Averages (EMAs). These constants are then used to compute a Scaled Smoothing Coefficient (SC) that adapts the moving average to the market's efficiency, making it faster during trending periods and slower in sideways markets.
Signal Generation: The AMA applies a filter, adjusted by a "gamma" parameter, to identify trading signals. This gamma influences the sensitivity towards trend or reversal signals, with options to adjust for focusing on either trend-following or counter-trend signals.
█ How to Use
Trend Identification: Use the AMA to identify the direction of the trend. An upward moving AMA indicates a bullish trend, while a downward moving AMA suggests a bearish trend.
Trend Trading: Look for buy signals when the AMA is trending upwards and sell signals during a downward trend. Adjust the fast and slow EMA lengths to match the desired sensitivity and timeframe.
Reversal Trading: Set the gamma to a positive value to focus on reversal signals, identifying potential market turnarounds.
█ Settings
Period for ER calculation: Defines the lookback period for calculating the Efficiency Ratio, affecting how quickly the AMA responds to changes in market efficiency.
Fast EMA Length and Slow EMA Length: Determine the responsiveness of the AMA to recent price changes, allowing traders to fine-tune the indicator to their trading style.
Signal Gamma: Adjusts the sensitivity of the filter applied to the AMA, with the ability to focus on trend signals or reversal signals based on its value.
AMA Candles: An innovative feature that plots candles based on the AMA calculation, providing visual cues about the market trend and potential reversals.
█ Alerts
The AMA Signals indicator includes configurable alerts for buy and sell signals, as well as positive and negative trend changes.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Optimal Length BackTester [YinYangAlgorithms]This Indicator allows for a ‘Optimal Length’ to be inputted within the Settings as a Source. Unlike most Indicators and/or Strategies that rely on either Static Lengths or Internal calculations for the length, this Indicator relies on the Length being derived from an external Indicator in the form of a Source Input.
This may not sound like much, but this application may allows limitless implementations of such an idea. By allowing the input of a Length within a Source Setting you may have an ‘Optimal Length’ that adjusts automatically without the need for manual intervention. This may allow for Traditional and Non-Traditional Indicators and/or Strategies to allow modifications within their settings as well to accommodate the idea of this ‘Optimal Length’ model to create an Indicator and/or Strategy that adjusts its length based on the top performing Length within the current Market Conditions.
This specific Indicator aims to allow backtesting with an ‘Optimal Length’ inputted as a ‘Source’ within the Settings.
This ‘Optimal Length’ may be used to display and potentially optimize multiple different Traditional Indicators within this BackTester. The following Traditional Indicators are included and available to be backtested with an ‘Optimal Length’ inputted as a Source in the Settings:
Moving Average; expressed as either a: Simple Moving Average, Exponential Moving Average or Volume Weighted Moving Average
Bollinger Bands; expressed based on the Moving Average Type
Donchian Channels; expressed based on the Moving Average Type
Envelopes; expressed based on the Moving Average Type
Envelopes Adjusted; expressed based on the Moving Average Type
All of these Traditional Indicators likewise may be displayed with multiple ‘Optimal Lengths’. They have the ability for multiple different ‘Optimal Lengths’ to be inputted and displayed, such as:
Fast Optimal Length
Slow Optimal Length
Neutral Optimal Length
By allowing for the input of multiple different ‘Optimal Lengths’ we may express the ‘Optimal Movement’ of such an expressed Indicator based on different Time Frames and potentially also movement based on Fast, Slow and Neutral (Inclusive) Lengths.
This in general is a simple Indicator that simply allows for the input of multiple different varieties of ‘Optimal Lengths’ to be displayed in different ways using Tradition Indicators. However, the idea and model of accepting a Length as a Source is unique and may be adopted in many different forms and endless ideas.
Tutorial:
You may add an ‘Optimal Length’ within the Settings as a ‘Source’ as followed in the example above. This Indicator allows for the input of a:
Neutral ‘Optimal Length’
Fast ‘Optimal Length’
Slow ‘Optimal Length’
It is important to account for all three as they generally encompass different min/max length values and therefore result in varying ‘Optimal Length’s’.
For instance, say you’re calculating the ‘Optimal Length’ and you use:
Min: 1
Max: 400
This would therefore be scanning for 400 (inclusive) lengths.
As a general way of calculating you may assume the following for which lengths are being used within an ‘Optimal Length’ calculation:
Fast: 1 - 199
Slow: 200 - 400
Neutral: 1 - 400
This allows for the calculation of a Fast and Slow length within the predetermined lengths allotted. However, it likewise allows for a Neutral length which is inclusive to all lengths alloted and may be deemed the ‘Most Accurate’ for these reasons. However, just because the Neutral is inclusive to all lengths, doesn’t mean the Fast and Slow lengths are irrelevant. The Fast and Slow length inputs may be useful for seeing how specifically zoned lengths may fair, and likewise when they cross over and/or under the Neutral ‘Optimal Length’.
This Indicator features the ability to display multiple different types of Traditional Indicators within the ‘Display Type’.
We will go over all of the different ‘Display Types’ with examples on how using a Fast, Slow and Neutral length would impact it:
Simple Moving Average:
In this example above have the Fast, Slow and Neutral Optimal Length formatted as a Slow Moving Average. The first example is on the 15 minute Time Frame and the second is on the 1 Day Time Frame, demonstrating how the length changes based on the Time Frame and the effects it may have.
Here we can see that by inputting ‘Optimal Lengths’ as a Simple Moving Average we may see moving averages that change over time with their ‘Optimal Lengths’. These lengths may help identify Support and/or Resistance locations. By using an 'Optimal Length' rather than a static length, we may create a Moving Average which may be more accurate as it attempts to be adaptive to current Market Conditions.
Bollinger Bands:
Bollinger Bands are a way to see a Simple Moving Average (SMA) that then uses Standard Deviation to identify how much deviation has occurred. This Deviation is then Added and Subtracted from the SMA to create the Bollinger Bands which help Identify possible movement zones that are ‘within range’. This may mean that the price may face Support / Resistance when it reaches the Outer / Inner bounds of the Bollinger Bands. Likewise, it may mean the Price is ‘Overbought’ when outside and above or ‘Underbought’ when outside and below the Bollinger Bands.
By applying All 3 different types of Optimal Lengths towards a Traditional Bollinger Band calculation we may hope to see different ranges of Bollinger Bands and how different lookback lengths may imply possible movement ranges on both a Short Term, Long Term and Neutral perspective. By seeing these possible ranges you may have the ability to identify more levels of Support and Resistance over different lengths and Trading Styles.
Donchian Channels:
Above you’ll see two examples of Machine Learning: Optimal Length applied to Donchian Channels. These are displayed with both the 15 Minute Time Frame and the 1 Day Time Frame.
Donchian Channels are a way of seeing potential Support and Resistance within a given lookback length. They are a way of withholding the High’s and Low’s of a specific lookback length and looking for deviation within this length. By applying a Fast, Slow and Neutral Machine Learning: Optimal Length to these Donchian Channels way may hope to achieve a viable range of High’s and Low’s that one may use to Identify Support and Resistance locations for different ranges of Optimal Lengths and likewise potentially different Trading Strategies.
Envelopes / Envelopes Adjusted:
Envelopes are an interesting one in the sense that they both may be perceived as useful; however we deem that with the use of an ‘Optimal Length’ that the ‘Envelopes Adjusted’ may work best. We will start with examples of the Traditional Envelope then showcase the Adjusted version.
Envelopes:
As you may see, a Traditional form of Envelopes even produced with a Machine Learning: Optimal Length may not produce optimal results. Unfortunately this may occur with some Traditional Indicators and they may need some adjustments as you’ll notice with the ‘Envelopes Adjusted’ version. However, even without the adjustments, these Envelopes may be useful for seeing ‘Overbought’ and ‘Oversold’ locations within a Machine Learning: Optimal Length standpoint.
Envelopes Adjusted:
By adding an adjustment to these Envelopes, we may hope to better reflect our Optimal Length within it. This is caused by adding a ratio reflection towards the current length of the Optimal Length and the max Length used. This allows for the Fast and Neutral (and potentially Slow if Neutral is greater) to achieve a potentially more accurate result.
Envelopes, much like Bollinger Bands are a way of seeing potential movement zones along with potential Support and Resistance. However, unlike Bollinger Bands which are based on Standard Deviation, Envelopes are based on percentages +/- from the Simple Moving Average.
We will conclude our Tutorial here. Hopefully this has given you some insight into how useful adding a ‘Optimal Length’ within an external (secondary) Indicator as a Source within the Settings may be. Likewise, how useful it may be for automation sake in the sense that when the ‘Optimal Length’ changes, it doesn’t rely on an alert where you need to manually update it yourself; instead it will update Automatically and you may reap the benefits of such with little manual input needed (aside from the initial setup).
If you have any questions, comments, ideas or concerns please don't hesitate to contact us.
HAPPY TRADING!
Volume-Weighted Kaufman's Adaptive Moving AverageThe Volume-Weighted Kaufman's Adaptive Moving Average (VW-KAMA) is a technical indicator that combines the Volume-Weighted Moving Average (VWMA) and the Kaufman's Adaptive Moving Average (KAMA) to create a more responsive and adaptable moving average.
Advantages:
Volume-Weighted: It takes into account the volume of trades, giving more weight to periods with higher trading volume, which can help filter out periods of low activity.
Adaptive: The indicator adjusts its smoothing constant based on market conditions, becoming more sensitive in trending markets and less sensitive in choppy or sideways markets.
Versatility: VW-KAMA can be used for various purposes, including trend identification, trend following, and determining potential reversal points and act as dynamic support and resistance level.
T3 JMA KAMA VWMAEnhancing Trading Performance with T3 JMA KAMA VWMA Indicator
Introduction
In the dynamic world of trading, staying ahead of market trends and capitalizing on volume-driven opportunities can greatly influence trading performance. To address this, we have developed the T3 JMA KAMA VWMA Indicator, an innovative tool that modifies the traditional Volume Weighted Moving Average (VWMA) formula to increase responsiveness and exploit high-volume market conditions for optimal position entry. This article delves into the idea behind this modification and how it can benefit traders seeking to gain an edge in the market.
The Idea Behind the Modification
The core concept behind modifying the VWMA formula is to leverage more responsive moving averages (MAs) that align with high-volume market activity. Traditional VWMA utilizes the Simple Moving Average (SMA) as the basis for calculating the weighted average. While the SMA is effective in providing a smoothed perspective of price movements, it may lack the desired responsiveness to capitalize on short-term volume-driven opportunities.
To address this limitation, our T3 JMA KAMA VWMA Indicator incorporates three advanced moving averages: T3, JMA, and KAMA. These MAs offer enhanced responsiveness, allowing traders to react swiftly to changing market conditions influenced by volume.
T3 (T3 New and T3 Normal):
The T3 moving average, one of the components of our indicator, applies a proprietary algorithm that provides smoother and more responsive trend signals. By utilizing T3, we ensure that the VWMA calculation aligns with the dynamic nature of high-volume markets, enabling traders to capture price movements accurately.
JMA (Jurik Moving Average):
The JMA component further enhances the indicator's responsiveness by incorporating phase shifting and power adjustment. This adaptive approach ensures that the moving average remains sensitive to changes in volume and price dynamics. As a result, traders can identify turning points and anticipate potential trend reversals, precisely timing their position entries.
KAMA (Kaufman's Adaptive Moving Average):
KAMA is an adaptive moving average designed to dynamically adjust its sensitivity based on market conditions. By incorporating KAMA into our VWMA modification, we ensure that the moving average adapts to varying volume levels and captures the essence of volume-driven price movements. Traders can confidently enter positions during periods of high trading volume, aligning their strategies with market activity.
Benefits and Usage
The modified T3 JMA KAMA VWMA Indicator offers several advantages to traders looking to exploit high-volume market conditions for position entry:
Increased Responsiveness: By incorporating more responsive moving averages, the indicator enables traders to react quickly to changes in volume and capture short-term opportunities more effectively.
Enhanced Entry Timing: The modified VWMA aligns with high-volume periods, allowing traders to enter positions precisely during price movements influenced by significant trading activity.
Improved Accuracy: The combination of T3, JMA, and KAMA within the VWMA formula enhances the accuracy of trend identification, reversals, and overall market analysis.
Comprehensive Market Insights: The T3 JMA KAMA VWMA Indicator provides a holistic view of market conditions by considering both price and volume dynamics. This comprehensive perspective helps traders make informed decisions.
Analysis and Interpretation
The modified VWMA formula with T3, JMA, and KAMA offers traders a valuable tool for analyzing volume-driven market conditions. By incorporating these advanced moving averages into the VWMA calculation, the indicator becomes more responsive to changes in volume, potentially providing deeper insights into price movements.
When analyzing the modified VWMA, it is essential to consider the following points:
Identifying High-Volume Periods:
The modified VWMA is designed to capture price movements during high-volume periods. Traders can use this indicator to identify potential market trends and determine whether significant trading activity is driving price action. By focusing on these periods, traders may gain a better understanding of the market sentiment and adjust their strategies accordingly.
Confirmation of Trend Strength:
The modified VWMA can serve as a confirmation tool for assessing the strength of a trend. When the VWMA line aligns with the overall trend direction, it suggests that the current price movement is supported by volume. This confirmation can provide traders with additional confidence in their analysis and help them make more informed trading decisions.
Potential Entry and Exit Points:
One of the primary purposes of the modified VWMA is to assist traders in identifying potential entry and exit points. By capturing volume-driven price movements, the indicator can highlight areas where market participants are actively participating, indicating potential opportunities for opening or closing positions. Traders can use this information in conjunction with other technical analysis tools to develop comprehensive trading strategies.
Interpretation of Angle and Gradient:
The modified VWMA incorporates an angle calculation and color gradient to further enhance interpretation. The angle of the VWMA line represents the slope of the indicator, providing insights into the momentum of price movements. A steep angle indicates strong momentum, while a shallow angle suggests a slowdown. The color gradient helps visualize this angle, with green indicating bullish momentum and purple indicating bearish momentum.
Conclusion
By modifying the VWMA formula to incorporate the T3, JMA, and KAMA moving averages, the T3 JMA KAMA VWMA Indicator offers traders an innovative tool to exploit high-volume market conditions for optimal position entry. This modification enhances responsiveness, improves timing, and provides comprehensive market insights.
Enjoy checking it out!
---
Credits to:
◾ @cheatcountry – Hann Window Smoothing
◾ @loxx – T3
◾ @everget – JMA
Adaptive Gaussian Moving AverageThe Adaptive Gaussian Moving Average (AGMA) is a versatile technical indicator that combines the concept of a Gaussian Moving Average (GMA) with adaptive parameters based on market volatility. The indicator aims to provide a smoothed trend line that dynamically adjusts to different market conditions, offering a more responsive analysis of price movements.
Calculation:
The AGMA is calculated by applying a weighted moving average based on a Gaussian distribution. The length parameter determines the number of bars considered for the calculation. The adaptive parameter enables or disables the adaptive feature. When adaptive is true, the sigma value, which represents the standard deviation, is dynamically calculated using the standard deviation of the closing prices over the volatilityPeriod. When adaptive is false, a user-defined fixed value for sigma can be input.
Interpretation:
The AGMA generates a smoothed line that follows the trend of the price action. When the AGMA line is rising, it suggests an uptrend, while a declining line indicates a downtrend. The adaptive feature allows the indicator to adjust its sensitivity based on market volatility, making it more responsive during periods of high volatility and less sensitive during low volatility conditions.
Potential Uses in Strategies:
-- Trend Identification : Traders can use the AGMA to identify the direction of the prevailing trend. Buying opportunities may arise when the price is above the AGMA line during an uptrend, while selling opportunities may be considered when the price is below the AGMA line during a downtrend.
-- Trend Confirmation : The AGMA can be used in conjunction with other technical indicators or trend-following strategies to confirm the strength and sustainability of a trend. A strong and steady AGMA line can provide additional confidence in the prevailing trend.
-- Volatility-Based Strategies : Traders can utilize the adaptive feature of the AGMA to build volatility-based strategies. By adjusting the sigma value based on market volatility, the indicator can dynamically adapt to changing market conditions, potentially improving the accuracy of entry and exit signals.
Limitations:
-- Lagging Indicator : Like other moving averages, the AGMA is a lagging indicator that relies on historical price data. It may not provide timely signals during rapidly changing market conditions or sharp price reversals.
-- Whipsaw in Sideways Markets : During periods of low volatility or when the market is moving sideways, the AGMA may generate false signals or exhibit frequent crossovers around the price, leading to whipsaw trades.
-- Subjectivity of Parameters : The choice of length, adaptive parameters, and volatility period requires careful consideration and customization based on individual preferences and trading strategies. Traders need to adjust these parameters to suit the specific market and timeframe they are trading.
Overall, the Adaptive Gaussian Moving Average can be a valuable tool in trend identification and confirmation, especially when combined with other technical analysis techniques. However, traders should exercise caution, conduct thorough analysis, and consider the indicator's limitations when incorporating it into their trading strategies.
TASC 2023.05 Cong Adaptive Moving Average█ OVERVIEW
TASC's May 2023 edition of Traders' Tips features an article titled "An Adaptive Moving Average For Swing Trading" by Scott Cong. The article presents a new adaptive moving average (AMA) that adjusts its parameters automatically based on market volatility. The AMA tracks price closely during trending movements and remains flat during congestion areas.
█ CONCEPTS
Conventional moving averages (MAs) use a fixed lookback period, which may lead to limited performance in constantly changing market conditions. Perry Kaufman's adaptive moving average , first described in his 1995 book Smarter Trading, is a great example of how an AMA can self-adjust to adapt to changing environments. Scott Cong draws inspiration from Kaufman's approach and proposes a new way to calculate the AMA smoothing factor.
█ CALCULATIONS
Following Perry Kaufman's approach, Scott Cong's AMA is calculated progressively as:
AMA = α * Close + (1 − α) * AMA(1),
where:
Close = Close of the current bar
AMA(1) = AMA value of the previous bar
α = Smoothing factor between 0 and 1, defined by the lookback period
The smoothing factor determines the performance of AMA. In Cong's approach, it is calculated as:
α = Result / Effort,
where:
Result = Highest price of the n period − Lowest price of the n period
Effort = Sum(TR, n ), where TR stands for Wilder’s true range values of individual bars of the n period
n = Lookback period
As the price range is always no greater than the total journey, α is ensured to be between 0 and 1.
kama
█ Description
An adaptive indicator could be defined as market conditions following indicator, in summary, the parameter of the indicator would be adjusted to fit its optimum value to the current price action. KAMA, Kaufman's Adaptive Moving Average, an adaptive trendline indicator developed by Perry J. Kaufman, with the notion of using the fastest trend possible based on the smallest calculation period for the existing market conditions, by applying an exponential smoothing formula to vary the speed of the trend (changing smoothing constant each period), as cited from Trading Systems and Methods p.g. 780 (Perry J. Kaufman). In this indicator, the proposed notion is on the Efficiency Ratio within the computation of KAMA, which will use a Dominant Cycle instead, an adaptive filter developed by John F. Ehlers, on determining the n periods, aiming to achieve an optimum lookback period, with respect to the original Efficiency Ratio calculation period of less than 14, and 8 to 10 is preferable.
█ Kaufman's Adaptive Moving Average
kama_ = kama + smoothing_constant * (price - kama )
where:
price = current price (source)
smoothing_constant = (efficiency_ratio * (fastest - slowest) + slowest)^2
fastest = 2/(fastest length + 1)
slowest = 2/(slowest length + 1)
efficiency_ratio = price - price /sum(abs(src - src , int(dominant_cycle))
█ Feature
The indicator will have a specified default parameter of: length = 14; fast_length = 2; slow_length = 30; hp_period = 48; source = ohlc4
KAMA trendline i.e. output value if price above the trendline and trendline indicates with green color, consider to buy/long position
while, if the price is below the trendline and the trendline indicates red color, consider to sell/short position
Hysteresis Band
Bar Color
other example
Another New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and this is a companion indicator to my previous script . This indicator still works off of the same concept as before with effort vs results but this indicator takes a slightly different approach and instead defines results as the absolute difference between the closing price and a closing price x bars ago. As you can see in my chart example, this indicator works great to stay with the current trend and provides either a stop loss or take profit target depending on which direction you are going in. As always, I use darker colors to show stronger signals and lighter colors to show normal signals. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicator scripts you would like to see me publish!
A New Adaptive Moving Average [CC]The New Adaptive Moving Average was created by Scott Cong (Stocks and Commodities Mar 2023) and his idea was to focus on the Adaptive Moving Average created by Perry Kaufman and to try to improve it by introducing a concept of effort vs results. In this case the effort would be the total range of the underlying price action since each bar is essentially a war of the bulls vs the bears. The result would be the total range of the close so we are looking for the highest close and lowest close in that same time period. This gives us an alpha that we can use to plug into the Kaufman Adaptive Moving Average algorithm which gives us a brand new indicator that can hug the price just enough to allow us to ride the stock up or down. I have color coded it to be darker colors when it is a strong signal and lighter colors when it is a normal signal. Buy when the line turns green and sell when it turns red.
Let me know if there are any other indicators you would like to see me publish!
Better Heiken-Ashi Candles w/ Expanded Source Types [Loxx]Better Heiken-Ashi Candles w/ Expanded Source Types is an indicator to compare regular candles to traditional Heiken-Ashi candles to "better" Heiken Ashi candles. This indicator and comparison study appears an oscillator. The purpose of this indicator is to demonstrate a better way to calculate HA candles and also to demonstrate expanded source types. This indicator is meant to be used by advanced Pine Coders who wish to add fine-tuning to their indicators and strategies.
What are Heiken Ashi "better" candles?
The "better formula" was proposed in an article/memo by BNP-Paribas (In Warrants & Zertifikate, No. 8, August 2004 (a monthly German magazine published by BNP Paribas, Frankfurt), there is an article by Sebastian Schmidt about further development (smoothing) of Heikin-Ashi chart.)
They proposed to use the following :
(Open+Close)/2+(((Close-Open)/(High-Low))*ABS((Close-Open)/2))
instead of using :
haClose = (O+H+L+C)/4
According to that document the HA representation using their proposed formula is better than the traditional formula.
What are traditional Heiken-Ashi candles?
The Heikin-Ashi technique averages price data to create a Japanese candlestick chart that filters out market noise.
Heikin-Ashi charts, developed by Munehisa Homma in the 1700s, share some characteristics with standard candlestick charts but differ based on the values used to create each candle. Instead of using the open, high, low, and close like standard candlestick charts, the Heikin-Ashi technique uses a modified formula based on two-period averages. This gives the chart a smoother appearance, making it easier to spots trends and reversals, but also obscures gaps and some price data.
What's going on with this indicator?
- First, we have the options to select the candlestick type: Regular, HA, HA Better
- Next, and to demonstrate the expanded source types, I've added a simple moving average. In the drop down for the SMA source you'll notice something very different from the typical TradingView source selector. Here's how to decode the new names for the sources:
Close = close
Open = open
High = high
Low = low
Median = hl2
Typical = hlc3
Weighted = hlcc4
Average = ohlc4
Average Median Body = (open+close)/2
Trend Biased = (see code, too complex to explain here)
Trend Biased (extreme) = (see code, too complex to explain here)
... for HA and HA better, see the same set up as above but with different open and close values to calcualate the other source types
- For the HA better calculations, we run the close value through either an Adaptive, Kaufman, or T3 smoothing filter. The length for these smoothing filters, either 2 or 3, can be found in the code and is a constant value that shouldn't be changed. This smoothing is in inline with what is described in the article mentioned above
- Lastly, I've placed an SMA over the oscillator so that the user can test out the various sources explained above
Included:
- Toggle on/off bar coloring
Greedy MA & Greedy Bollinger Bands This moving average takes all of the moving averages between 1 and 700 and takes the average of them all. It also takes the min/max average (donchian) of every one of those averages. Also included is Bollinger Bands calculated in the same way. One nice feature I have added is the option to use geometric calculations for. I also added regular bb calculations because this can be a major hog. Use this default setting on 1d or 1w. Enjoy!
ps, I call it greedy because the default settings wont work on lower time frames
Ehlers Median Average Adaptive Filter [CC]The Median Average Adaptive Filter was created by John Ehlers and this is another in my current series of undiscovered gems. I'm sure you are all saying but Franklin, Ehlers doesn't have any undiscovered gems but in this case you would be wrong. This was actually an indicator so buried on the internet that I had to use the wayback machine to find the original source code. Ehlers notoriously hates adaptive moving averages which is funny because he has made a decent amount of them. This is a very unique indicator that uses a while loop to adjust the length and I thought it deserved some extra recognition from the TV community. I have included strong buy and sell signals in addition to normal ones so strong signals are darker in color and normal signals are lighter in color. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts or indicators you would like to see me publish!
+ Ultimate MAWhat is the "Ultimate MA" exactly, you ask? Simple. It actually takes as its influence the Rex Dog Moving Average (which I have included as an MA in some of my other indicators), an invention by xkavalis that is simply an average of different length moving averages.
It's available for free on his account, so take a look at it.
I've recently become drawn to using fibonacci sequence numbers as lookbacks for moving averages, and they work really well (I'm honestly beginning to think the number doesn't matter).
You can see where this is going. The Ultimate MA is an average of several (eight) moving averages of varying lengths (5 - 144) all of fibonacci numbers. Sounds pretty basic, right? That's not actually the case, however.
If you were to take all these numbers, add them up, then average them by eight you'd get ~46. Now, stick a 46 period moving average on the chart and compare it to this one and see what you get. They track price very differently. Still, this all sort of sounds like I'm copying the RDMA, which isn't a sin in itself but is hardly grounds for releasing a new MA into the wild.
The actual initial problem I wanted to tackle was how to take in to account for the entire range of price action in a candle in a moving average. ohlc4 sort of does this, but it's still just one line that is an average of all these prices, and I thought there might be a better way not claiming that what I came upon is, but I like it).
My solution was to plot two moving averages: one an average of price highs, and the other an average of lows, thus creating a high/low price channel. Perhaps this is not a new thing at all. I don't know. This is just an idea I had that I figured I could implement easily enough.
Originally I had just applied this to a 21 period EMA, but then the idea sort of expanded into what you see here. I kept thinking "is 21 the best?" What about faster or slower? Then I thought about the RDMA and decided on this implimentation.
Further, I take the high and low moving averages and divide them by two in order to get a basis. You can turn all this stuff on or off, though I do like the default settings.
After that I wanted to add bands to it to measure volatility. There is an RDMA version that utilizes ATR bands, but I could never find myself happy with these.
I just wanted something... else. I also, actually made my own version of xkavalis' RDMA bands with some of the extra stuff I included here, but obviously didn't feel comfortable releasing it as an indicator as I hadn't changed it enough significantly in my mind to fairly do so. I eventually settled on Bollinger Bands as an appropriate solution to apply to the situation. I really like them. It took some fiddling because I had to create a standard deviation for both the high and low MAs instead of just one, and then figure out the best combination of moving averages and standard deviations to add and subtract to get the bands right.
Then I decided I wanted to add a few different moving averages to choose from instead of just an EMA even though I think it's the "best." I didn't want to make things too complicated, so I just went with the standards--EMA, SMA, WMA, HMA-- + 1, the ALMA (which gives some adjustability with its offset and sigma).
Also, you can run more than one moving average at a time (try running an HMA with a slower one).
Oh yeah, the bands? You can set them, in a dropdown box, to be based on which ever moving average you want.
Furthermore, this is a multi-timeframe indicator, so if you want to run it on a higher time frame than the one you are trading on, it's great for that.
ALSO, I actually have the basis color setup as multi-timeframe. What this means is that if you are looking at an hourly chart, you can set the color to a 4h (or higher) chart if you want, and if the current candle is above or below the previous close of the basis on that higher timeframe you will know simply by looking at the color of it ((while still being on the hourly chart). It's just a different way of utilizing higher timeframe information, but without the indicator itself plotted as higher timeframe.
I'm nearly finished. Almost last thing is a 233 period moving average. It's plotted as an average of the SMA, EMA, and Kijun-sen.
Lastly, there are alerts for price crossing the inner border of the bands, or the 233 MA.
Below is a zoomed in look at a chart.
Much credit and gratitude to xkavalis for coming up with the idea of an average of moving averages.
Ehlers Kaufman Adaptive Moving Average [CC]The Kaufman Adaptive Moving Average was created by Perry Kaufman and this is a variation of that original formula created by John Ehlers. I have included a side by side with an original script (blue line) done by @HPotter that shows that Ehlers version is slightly more reactive compared to the original version. I have included strong buy and sell signals in addition to normal ones and so darker colors are strong signals and lighter colors are normal ones. Buy when the line turns green and sell when it turns red.
Let me know if there are any other scripts you would like to see me publish!
Advance AMA with Sylvain BandsMany traders believe that the moving averages are favorite tools and analysts have spent decades trying to improve moving averages partiularly the simple moving average. One way to address the disadvantages of moving averages is to multiply the weighting factor by a volatility ratio which is called Adaptive moving averages.
This indicator uses an special adaptive moving averages which is developed by John Ehlers. The model adapts to price movement “based on the rate change of phase as measured by the Hilbert Transform Discriminator”. This method of adaptation features a fast and a slow moving average so that the composite moving average swiftly responds to price changes and holds the average value until the next bars close. In addition, the smoothed Volatility Bands were created by Sylvain Vervoort is included.
Rainbow Adaptive RSI [LuxAlgo]The following oscillator uses an adaptive moving average as an input for another RSI oscillator and aims to provide a way to minimize the impact of retracements over the oscillator output without introducing significant lag.
An additional trigger line is present in order to provide entry points from the crosses between the oscillator and the trigger line. More details are given below.
Settings
Length : period of the oscillator
Power : controls the sensitivity of the oscillator to retracements, with higher values minimizing the sensitivity to retracements.
Src : source input of the indicator
The indicator also includes the following graphical settings:
Gradient : Determines the color mode to use for the gradient, options include "Red To Green", "Red To Blue" and "None", with "None" displaying no gradient.
Color fill : Determines whether to fill the area between the oscillator and the trigger line or not, by default "On".
Circles : Determines whether to show circles highlighting the crosses between the oscillator and the trigger line.
Usage
The indicator can be used like any normalized oscillator, but unlike a classical RSI, it does not converge toward 50 with higher length values. This is caused by the RSI using a smooth input.
The power setting will minimize the impact of certain variations on the oscillator:
Here the oscillator at the bottom uses a power value of 1.5.
The trigger line is a smoothed RSI using an EMA as input, and it won't remain as near to 100 and 0 as the main oscillator. Using a moving average of the main oscillator as a trigger line would create faster crosses, but this approach allows us to have no crosses when a retracement is present.
Details
As previously discussed the main oscillator uses an adaptive moving average as input; this adaptive moving average is computed using a smoothing factor derived from an RSI oscillator, a similar adaptive moving average known as ARSI, but unlike ARSI which uses a classical RSI of the closing price for the calculation of the smoothing factor, our smoothing factor makes use of RSI on the adaptive moving average error, which provides a higher level of adaptiveness.
Trend Regularity Adaptive Moving Average [LuxAlgo]The following moving average adapt to the average number of highest high/lowest low made over a specific period, thus adapting to trend strength. Interesting results can be obtained when using the moving average in a MA crossover system or as a trailing support/resistance.
Settings
Length : Period of the indicator, with higher values returning smoother results.
Src : Source input of the indicator.
Usage
The trend regularity adaptive moving average (TRAMA) can be used like most moving averages, with the advantage of being smoother during ranging markets.
Notice how the moving closer to the price the longer a trend last, such effect can be practical to have early entry points when using the moving average in a MA crossover system, such effect is due to the increasing number of average highest high/lowest low made during longer trends. Note that in the case of a significant uptrend followed by a downtrend, the moving average might penalize the start of the downtrend (and vice versa).
The moving average can also act as an interesting trailing support/resistance.
Details
The moving average is calculated using exponential averaging, using as smoothing factor the squared simple moving average of the number of highest high/lowest low previously made, highest high/lowest low are calculated using rolling maximums/minimums.
Using higher values of length will return fewer highest high/lowest low which explains why the moving average is smoother for higher length values. Squaring allows the moving average to penalize lower values, thus appearing more stationary during ranging markets, it also allows to have some consistency regarding the length setting.
🧙 this moving average would not be possible without the existence of corn syrup 🦎
Ehlers Mother Of Adaptive Moving Averages [CC]The Mother Of Adaptive Moving Averages was created by John Ehlers (Rocket Science For Traders pgs 182-183) and this is definitely my favorite Ehlers moving average script. This works as a trend indicator and a typical moving average. When the mama is above the fama then the stock is in an uptrend and vice versa. Of course it is also good when the price is above the fama and mama lines. Buy when the indicator line is green and sell when it is red.
Let me know if there are other indicator scripts you would like to see me publish or if you want something custom done!
Vertical Horizontal Moving Average [AneoPsy & alexgrover] Moving average adapting to the strength of the trend, this is made possible by using the square of the vertical-horizontal filter as a smoothing factor. Alerts are included with two different types of conditions available to the user.
Settings
Length : Period of the moving average
Src : Input data for the indicator
Alerts : Types of conditions to be used in the alerts, when set to "VHMA Direction Change" alerts are triggered once the VHMA is either rising or declining, else the alerts are based on the crosses between Src and the VHMA
Usage
The VHMA can be used as a fast or slow-moving average in a moving average crossover system, or as input for other indicators.
VHMA of with length = 25 and sma with length = 200.
VHMA with length = 25 used as input for the RSI with length = 14.
Details
The vertical-horizontal filter is a measure of the strength of the trend and lay in a (0,1) range, to calculate it you just need to divide the rolling range over with the rolling sum of the absolute price changes, squaring the result allow to get lower results with higher values of length .
Squared vertical horizontal filter with length = 50, the value is low when the market is ranging and high when trending.
To set the alerts go in the alert panel, click on create alert, and select VHMA in "condition", choose between the buy or sell alert. If Src = closing price or another indicator dependant on the closing price select in options "once per bar close", if the indicator using the opening or lagged closing prices values as input select "One per bar" instead.
Thanks
Thanks to AneoPsy for adding the color change, the idea to use two kinds of conditions for the alert, and for its feedback, you can follow him
www.tradingview.com
and finally thanks to you for reading and for your support, only one last script left for the month, then we'll start July with some pretty interesting indicators, I hope you'll like them ^^/
Moving Average Adaptive QThe Moving Average Adaptive Q (MAAQ) was authored by Perry Kaufman in the Stocks and Commodities Magazine 06/1995
This is similar to his Kaufman Adaptive Moving Average with a few changes. This is a pretty close moving average which I like quite a bit. Try it and let me know what you think.
Send me a message and let me know what other indicators you would like to see!
Minkowski Distance Factor Adaptive Period MACDHi, this script comes from the idea that Ricardo Santos' Minkovski Distance Function is transferred to the period as a factor.
Minkowski distance is used as a percentage factor with the help of Relative Strength Index function.
Minkowski Distance Function Script :
And thus an adaptive MACD was created.
This script can give much better results in more optimized larger periods.
I leave the decision to determine the periods and weights.
I used the weights of 9,12,26 and periods created with multiplied by factor.
Regards.
Deviation Scaled Moving Average [ChuckBanger]This is a deviation scaled moving average original designed by John Ehlers. It is a new adaptive moving average that has the ability to rapidly adapt to volatility in price movement with minimal lag. Because it is so smooth and adapts to the volatility of the market it is by far a really great tool for spotting trend changes