Programming a visual and audible alert for the TradingView platform in PineScript Language.

The same indicator (disparity index SMA by DRodriguezFX) is applied to two highly correlated instruments. The indicator values are then compared to each other to find instances when they diverge. Divergence is determined using simple maths. Divergence can occur in 3 ways:

1) indicators move in opposite directions. (one increases, while the other decreases)

2) One remains unchanged, while other increases or decreases.

3) Both move in same direction, but one moves a greater magnitude. In this case the first step involved is to determine by how much % the indicator has moved from the last value / one candle / period ago.

Example: Disparity indicator on instrument 1 moves from 0.0070 to 0.0080 = +0.0010

So 0.0010 / 0.0070 = 0.143 X 100 = 14.30%

Disparity indicator on instrument 2 moves from 0.0070 to 0.0075 = +0.0005

so 0.0005 / 0.0070 = 0.0714 X 100 = 7.14%

Now take the greater value and divide by smaller value then multiply by 100

= 14.30 / 7.14 X 100 = 200.28% Therefore one indicator moved 200.28% the value of the other. This % threshold value will be a custom input to determine if divergence has occurred. In other words if they both move in the same direction, divergence will only be shown if one moves by X% of the value of the first.

Once divergence has been confirmed, an arrow will be drawn on price in the opposite direction of the closing candle. So for example if divergence is confirmed and the candle closed higher, then a down arrow would be drawn above this candle and vice versa. If the candles close and open are the same, the previous candles range is used instead.

Considerations:

Note two instances of this indicator plotted for two different instruments cant be loaded in the same window. But as long as the corresponding values are compared, this shouldn't be a problem.

Indicator should be constantly monitoring every bar close to determine if divergence has occurred.

Compétences : Codage, Marchés Financiers, HTML5, Metatrader, Programmation

Concernant l'employeur :
( 0 commentaires ) KHARAGPUR, India

Nº du projet : #18967038

## 1 freelance fait une offre moyenne de \$120 pour ce travail

consultantcae

Hi, I am Sourabh Jain, I am interested in project. I have recently written a custom indicator based on stochRSI and heikin ashi values which give signals (arrow) for buy and sell, provides alerts( pop-up, sound and e- Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 3 jours
(16 Commentaires)
4.8