Ni6HTH4wK

Relative Price Difference [LAVA]

200
EDIT: Look below for updates to the script.

EDIT: After several updates to this script, I think it's safe to say it will work with all timelines. Using hand drawn trendlines, it can predict tops and bottoms with pretty good accuracy.

Shows a change in the relative price difference via percentage on a 0 horizontal. Added a bollinger band to help identify weak areas (orange). If orange starts showing, the current price direction is strong but can reverse harshly. If you are in a weak position, exit here. Otherwise, don't enter a trade after/during orange sessions until a full cycle (up/dn > 1% without orange) has completed. The main line indicator fluctuates according to the price difference. 1% horizontal lines are added to help identify profit taking spots or OTE zones. Ensure the 1% line is crossed completely before you decide to enter/exit. Cross points are identified with crosses if you missed your window, this is the last spot to exit, enter. This indicator doesn't work that well with small time intervals. As always, use more than one indicator to ensure your decision is right. (The colors are ugly so change them if you wish! :)
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?
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)
zero = 0.000001

hi = (high/highest(len))*100
lo = (low/lowest(len))*100
opens = (open+open[len])/2
closes = (close+close[len])/2
raw = open>close ? hi-lo : lo-hi
smoothed = swma(raw)
RPD = vwma(smoothed,len/2)
dev = mult * stdev(RPD, len)
upper = RPD + dev
lower = RPD - dev

plot(RPD, color=aqua)
hline(1, title='top line', color=#303030, linestyle=dotted, linewidth=1)
hline(-1, title='top line', color=#303030, linestyle=dotted, linewidth=1)

p0 = plot(zero, color=black)
p1 = plot(upper, color=black)
p2 = plot(lower, color=black)
fill(p0, p1, color=yellow, transp=70)
fill(p0, p2, color=red, transp=70)

LOOKUP = cross(RPD,zero) ? 1.2 : na
LOOKDN = cross(RPD,zero) ? -1.2 : na
plot(LOOKUP, title="Bingo", style=cross, linewidth=2, color=gray)
plot(LOOKDN, title="Bingo", style=cross, linewidth=2, color=gray)