Sherlock_MacGyver

Adaptive MA-Bollinger Histogram

Sherlock_MacGyver 已更新   
Visualize two of your favorite moving averages in a fun new way.
This script calculates the distance (or difference) between the price and two moving averages of your choosing and then creates two histograms.

The two histograms are plotted inversely, so if the price is over both moving averages, one will be positive above the centerline while the other still positive will be below the centerline.
(In a future update you will have the option to have them both positive at the same time)

Next, what it does is apply Bollinger Bands (optional) to each of the histograms.
This creates a very interesting effect that can highlight areas of interest you may miss with other indicators.

You have plenty of options for coloring, the type of moving average, Bollinger Band length, and toggling features on and off.

Give it a few minutes of your time to study, and see what information you can learn from watching this indicator by comparing it with the chart.

Here is a full user guide:

Adaptive MA-Bollinger Histogram Indicator User Guide

Welcome to the user guide for the **Adaptive MA-Bollinger Histogram** indicator. This custom indicator is designed to help traders analyze trends and potential reversals in a financial instrument's price movements. The indicator combines two Moving Averages (MA) and Bollinger Bands to provide valuable insights into market conditions.

### Indicator Overview

The Adaptive MA-Bollinger Histogram indicator comprises the following components:

1. **Moving Averages (MA1 and MA2):** The indicator uses two moving averages, namely MA1 and MA2, to track different time periods. MA1 has a user-defined length (default: 50) and MA2 has a longer user-defined length (default: 100). These moving averages can be calculated using different methods such as Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA), Volume Weighted Moving Average (VWMA), or Smoothed Moving Average (RMA).

2. **Histograms:** The indicator displays histograms based on the differences between the price source and the respective moving averages. Positive values of the histogram for MA1 are plotted in one color (default: green), while negative values are plotted in another color (default: red). Similarly, positive values of the histogram for MA2 are plotted in one color (default: blue), while negative values are plotted in another color (default: yellow). It's important to note that the histogram for MA1 is plotted positively, while the histogram for MA2 is plotted inversely.

3. **Bollinger Bands:** The indicator also features Bollinger Bands calculated based on the differences between the price source and the respective moving averages (dist1 and dist2). Bollinger Bands consist of three lines: the middle band, upper band, and lower band. These bands help visualize the potential volatility and overbought/oversold levels of the instrument's price.

### Understanding the Indicator

- **Histograms:** The histograms highlight the divergence between the price and the two moving averages. When the histogram for MA1 is positive, it indicates that the price is above the MA1. Conversely, when the histogram for MA1 is negative, it suggests that the price is below the MA1. Similarly, the histogram for MA2 is plotted inversely.

- **Bollinger Bands:** The Bollinger Bands consist of three lines. The middle band represents the moving average (MA1 or MA2), while the upper and lower bands are calculated based on the standard deviation of the differences between the price source and the moving average. The bands expand during periods of higher volatility and contract during periods of lower volatility.

### Possible Trading Ideas

1. **Trend Confirmation:** When the histograms for both MA1 and MA2 are consistently positive, it may indicate a strong bullish trend. Conversely, when both histograms are consistently negative, it may suggest a strong bearish trend.

2. **Divergence:** Divergence between price and the histograms could signal potential reversals. For example, if the price is making new highs while the histogram is declining, it might indicate a bearish divergence and a possible upcoming trend reversal.

3. **Bollinger Bands Squeeze:** A narrowing of the Bollinger Bands indicates lower volatility and often precedes a significant price movement. Traders might consider a potential breakout trade when the bands start to expand again.

4. **Overbought/Oversold Levels:** Prices touching or exceeding the upper Bollinger Band could suggest overbought conditions, while prices touching or falling below the lower Bollinger Band could indicate oversold conditions. Traders might look for reversals or corrections in such scenarios.

### Customization

- You can adjust the parameters such as MA lengths, Bollinger Bands length, width, and colors to suit your preferences and trading strategy.

### Conclusion

The **Adaptive MA-Bollinger Histogram** indicator provides a comprehensive view of price trends, divergences, and potential reversal points. Traders can use the information from this indicator to make informed decisions in their trading strategies. However, like any technical tool, it's recommended to combine this indicator with other forms of analysis and risk management techniques for optimal results.



版本注释:
I have added the option to have 3 configurations:
MA1 and MA2 plotted with positive values above the centerline and negative below.
MA1 and MA2 plotted inverted with negative values above the centerline and positive values above.
MA1 and MA2 plotted inversely where MA1 is positive above and MA2 is positive below.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?