EltAlt

Price Divergence Indicator

This Price Divergence Indicator indicator modifies the standard Divergence Indicator to look for price divergences between the current chart and any other selected TradingView chart.

The thesis that this indicator is built upon:
Prices on assets or indices that are normally correlated move in lock step. Where there are deviations between the confirmed highs or lows of two assets or indices it is likely that they will "catch up" in the near future.

By default it will load the price data for the SPX and look for price divergences on the current chart timeframe. Any TradingView Symbol can be selected as the 'Comparison Source' and any timeframe. Some of the options I've been trying out include:
SPX vs NDQ
XAO vs SPX
UK100 vs NDQM
MSFT vs NDQM
GOOG vs NDQM
AMZN vs MSFT
BTC vs ETH
BTC vs NDQ
BTC vs DXY
I've found looking for divergences on a longer timeframe can be useful and don't expect any meaningful results if you set it to shorter than chart timeframes.

Alerts can be created based on any of the divergences and the 'Backtest Buy Signal' can be used to send notification to a backtester (bull = 2, hidden bull = 1, neutral = 0, hidden bear = -1, bear = -2), this is plotted to display.none, so enable it in Settings - Style and disable all other plots to see it.

Divergences are measured between the CONFIRMED peaks of the two charts. The confirmation timeframe is set using 'Pivot Lookback Right'. The lower the lookback the quicker the signal and the more likely it is to not have hit an actual peak, a higher lookback will give a much more dependable signal but the move may be finished by the time the alert actually fires. The "Plot When Alerts Fire" option should give you an idea (top and bottom triangles) of what to expect, but you should watch bar replays to understand how your setting will impact when alerts are created and potential false positives.
Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?