Ni6HTH4wK

[LAVA] Relative Price Difference

This script shows the relative price difference based off the last high and low, so many bars ago. Bollinger bands are also included by default for closer inspection on the intensity of the movement or the lack thereof. Bollinger bands will follow the smoothed line which will allow the reactionary line to cross the boundary during an intense movement. With the colors selected, a gray color will appear after the color to the zero line to announce a deep correction is possible. Buy/Sell indicators show up as crosses to indicate when the price is moving in a certain direction. Sideways stagnation will have several crosses due to the close proximity to the zero line.

I use 21 in the demo here without the bollinger bands or buy/sell indicators to show the power of the script to identify bottoms and tops using the tips and hand drawn trendlines.

(This script is actually the same script as before, but listed here as the final version. Hopefully this will be my last update with this script.)

If you use and enjoy this script, please like it!
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?
study(title="[LAVA] Relative Price Difference", shorttitle="RPD_L")
len = input(14, minval=1, title="Length")
mult = input(2.0, minval=0.001, maxval=50)

high_ = highest(high, len*3)
low_ = lowest(low, len*3)
RPD = 100 - 100/(1 +((high/high_) - (low_/low)))
SRPD = swma(RPD)

dev = mult * stdev(SRPD, len*2)
upper = SRPD + dev
lower = SRPD - dev

p0 = plot(0.000001, color=black)
p1 = plot(upper, style=area, color=#FF8400, transp=65)
p2 = plot(lower, style=area, color=#007BFF, transp=65)

plot(SRPD, title="SRPD", color=red, linewidth=2)
plot(RPD, title="RPD", color=lime, linewidth=1)

LOOKUP = (cross(SRPD,1) or cross(SRPD,-1) or cross(SRPD,-1)[1]) and SRPD>SRPD[1] and SRPD[1]>SRPD[2] ? -1.5 : na
LOOKDN = (cross(SRPD,-1) or cross(SRPD,1) or cross(SRPD,1)[1]) and SRPD<SRPD[1] and SRPD[1]<SRPD[2] ? 1.5 : na
plot(LOOKUP, title="Bingo", style=cross, linewidth=3, color=green)
plot(LOOKDN, title="Bingo", style=cross, linewidth=3, color=red)