jorgelg93

MACDh with divergences & impulse system (overlayed on prices)

-----------------------------------------------------------------
General Description:

This indicator (the one on the top panel above) consists on some lines, arrows and labels drawn over the price bars/candles indicating the detection of regular divergences between price and the classic MACD histogram (shown on the low panel). This script is special because it can be adjusted to fit several criteria when trading divergences filtering them according to the "height" and "width" of the patterns. The script also includes the "extra features" Impulse System and Keltner Channels, which you will hardly find anywhere else in similar classic MACD histogram divergence indicators.

The indicator helps to find trend reversals, and it works on any market, any instrument, any timeframe, and any market condition (except against really strong trends that do not show any other sign of reversion yet).

Please take on consideration that divergences should be taken with caution.


-----------------------------------------------------------------
Definition of classic Bullish and Bearish divergences:

*Bearish divergences occur in uptrends identifying market tops. A classical or regular bearish divergence occurs when prices reach a new high and then pull back, with an oscillator (MACD histogram in this case) dropping below its zero line. Prices stabilize and rally to a higher high, but the oscillator reaches a lower peak than it did on a previous rally.

In the chart above (weekly charts of NKE, Nike, Inc.), in area X (around August 2021), NKE rallied to a new bull market high and MACD-Histogram rallied with it, rising above its previous peak and showing that bulls were extremely strong. In area Y, MACD-H fell below its centerline and at the same time prices punched below the zone between the two moving averages. In area Z, NKE rallied to a new bull market high, but the rally of MACD-H was feeble, reflecting the bulls’ weakness. Its downtick from peak Z completed a bearish divergence, giving a strong sell signal and auguring a nasty bear market.

*Bullish divergences, in the other hand, occur towards the ends of downtrends identifying market bottoms. A classical (also called regular) bullish divergence occurs when prices and an oscillator (MACD histogram in this case) both fall to a new low, rally, with the oscillator rising above its zero line, then both fall again. This time, prices drop to a lower low, but the oscillator traces a higher bottom than during its previous decline.

In the example in the chart above (weekly charts of NKE, Nike, Inc.), you see a bearish divergence that signaled the October 2022 bear market bottom, giving a strong buy signal right near the lows. In area A, NKE (weekly charts) appeared in a free fall. The record low A of MACD-H indicated that bears were extremely strong. In area B, MACD-H rallied above its centerline. Notice the brief rally of prices at that moment. In area C, NKE slid to a new bear market low, but MACD-H traced a much more shallow low. Its uptick completed a bullish divergence, giving a strong buy signal.


-----------------------------------------------------------------
Some cool features included in this indicator:

1. This indicator also includes the “Impulse System”. The Impulse System is based on two indicators, a 13-day exponential moving average and the MACD-Histogram, and identifies inflection points where a trend speeds up or slows down. The moving average identifies the trend, while the MACD-Histogram measures momentum. This unique indicator combination is color coded into the price bars for easy reference.

Calculation:
Green Price Bar: (13-period EMA > previous 13-period EMA) and
(MACD-Histogram > previous period's MACD-Histogram)

Red Price Bar: (13-period EMA < previous 13-period EMA) and
(MACD-Histogram < previous period's MACD-Histogram)

Price bars are colored blue when conditions for a Red Price Bar or Green Price Bar are not met. The MACD-Histogram is based on MACD(12,26,9).

The Impulse System works more like a censorship system. Green price bars show that the bulls are in control of both trend and momentum as both the 13-day EMA and MACD-Histogram are rising (you don't have permission to sell). A red price bar indicates that the bears have taken control because the 13-day EMA and MACD Histogram are falling (you don't have permission to buy). A blue price bar indicates mixed technical signals, with neither buying nor selling pressure predominating (either both buying or selling are permitted).

2. Another "extra feature" included here is the "Keltner Channels". Keltner Channels are volatility-based envelopes set above and below an exponential moving average.

3. It were also included a couple of EMAs.

Everything can be removed from the chart any time.


-----------------------------------------------------------------
Options/adjustments for this indicator:

*Horizontal Distance (width) between two tops/bottoms criteria.
Refers to the horizontal distance between the MACH histogram peaks involved in the divergence

*Height of tops/bottoms criteria (for Histogram).
Refers to the difference/relation/vertical distance between the MACH HISTOGRAM peaks involved in the divergence: 1st Histogram Peak is X times the 2nd.

*Height/Vertical deviation of tops/bottoms criteria (for Price).
Deviation refers to the difference/relation/vertical distance between the PRICE peaks involved in the divergence.

*Plot Regular Bullish Divergences?.

*Plot Regular Bearish Divergences?.

*Delete Previous Cancelled Divergences?.

*Shows a pair of EMAs.

*Shows Keltner Channels (using ATR)
Keltner Channels are volatility-based envelopes set above and below an exponential moving average.

*This indicator also has the option to show the Impulse System over the price bars/candles.



오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?