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!
Скрипт с открытым кодом

В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать этот скрипт на графике?
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)