RicardoSantos

[RS]Multiple Time Frame Range Swing V0

EXPERIMENTAL:
(republishing, previous had alot of lines crowding the chart)
MTF Range Swing.
Açık kaynak kodlu komut dosyası

Gerçek TradingView ruhuyla, bu betiğin yazarı, yatırımcının anlayabilmesi ve doğrulayabilmesi için onu açık kaynak olarak yayınladı. Yazarın eline sağlık! Bunu ücretsiz olarak kullanabilirsiniz, ancak bu kodun bir yayında yeniden kullanımı Kullanım Koşulları ile yönetilir. Bir grafikte kullanmak için favorilere ekleyebilirsiniz.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.

Bu komut dosyasını bir grafikte kullanmak ister misiniz?
study(title='[RS]Multiple Time Frame Range Swing V0', shorttitle='[RS]MTF.RS.V0', overlay=true)
window = input(2)
tf = input('D')
h = security(tickerid, tf, valuewhen(high>=highest(window), high, 0))
l = security(tickerid, tf, valuewhen(low<=lowest(window), low, 0))
hl = security(tickerid, tf, valuewhen(l>=highest(l, window), l, 0))//highest(lowest(window), window))
lh = security(tickerid, tf, valuewhen(h<=lowest(h, window), h, 0))//lowest(highest(window), window))

ph = plot(title='High Extreme', series=h, style=line, color=green, linewidth=1)
pl = plot(title='Low Extreme', series=l, style=line, color=maroon, linewidth=1)
plh = plot(title='Lower High Extreme', series=lh, style=line, color=green, linewidth=1)
phl = plot(title='Higher Low Extreme', series=hl, style=line, color=maroon, linewidth=1)

fill(ph, plh, color=gray, transp=70)
fill(pl, phl, color=gray, transp=70)

median = avg(h, l)
osc = close > median ? avg(median, h) : avg(median, l)

po = plot(title='Directional Oscillator', series=osc, style=circles, color=osc > median ? lime : red, linewidth=2)
pm = plot(title='Median', series=median, style=circles, color=osc > median ? olive : orange, linewidth=2)

fill(po, pm, color=blue, transp=70)

lr_m = na(lr_m[1]) ? median : close > lr_m[1] ? lr_m[1]+abs(median-lr_m[1])*0.10 : lr_m[1]-abs(median-lr_m[1])*0.10
plot(title='Linear Regression Average Line:', series=lr_m, color=black)