TradingView
EltAlt
16 Th11 2022 02:45

Price Divergence Indicator 

Alphabet Inc.NASDAQ

Mô tả

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.
Bình luận
mupatsa
Thanks for making the source code open
jacksonsandland1
How do you change what you are comparing against?
Batycoda12
How do you get a notification when there's a signal? I'd like to get an email and text notification using the TradingView standard alert options.
elenasherg5
Hi! How can I change a script to put two ticker to be ploted at once?
EltAlt
@elenasherg5, You'd need to open two copies of the indicator, one for each ticker.
EltAlt
I'm going to have to fix the "Cpmparison Price" typo, have you got suggestions for anything else I could add / change while I'm at it?
Thêm nữa