RicardoSantos

[RS]Average Advance and Decline Lines V0

Method to draw linear regression lines from average price advance&decline range
Favori Komutlardan Çıkart Favori Komutlara Ekle
study("[RS]AA&DL.V0", overlay=true)
//  ||---   Inputs:
tempname = input("text")
risingdecaymultiplier = (syminfo.mintick*input(30.000, type=float))
fallingdecaymultiplier = (syminfo.mintick*input(30.000, type=float))
marginmultiplier = input(10)
hidefallingline = input(false)
hiderisingline = input(false)
hidetopmargin = input(false)
hidebottommargin = input(false)
//  ||---   Get the decay averages for tops and bottoms.
topdecay = high >= nz(topdecay[1]) ? high : nz(topdecay[1]) - fallingdecaymultiplier
botdecay = n < 10 ? low : low <= nz(botdecay[1]) ? low : nz(botdecay[1]) + risingdecaymultiplier
//  ||---   Get the margin for entry
tmargin = topdecay - (fallingdecaymultiplier*marginmultiplier)
bmargin = botdecay + (risingdecaymultiplier*marginmultiplier)
//  ||---   Detect if price is in challenge zone or outside(trending/breakout)
breakoutup = close > bmargin ? true : false
breakoutdown = close < tmargin ? true : false
//  ||---   Color Switchs:
topdecaycolor = breakoutdown ? topdecay < topdecay[1] ? maroon : na : topdecay < topdecay[1] ? gray : na
botdecaycolor = breakoutup ? botdecay > botdecay[1] ? green : na : botdecay > botdecay[1] ? gray : na
//  ||---   Outputs:
plot(hidefallingline ? na : topdecay, color=topdecaycolor, style=linebr, linewidth=2, join=true)
plot(hiderisingline ? na : botdecay, color=botdecaycolor, style=linebr, linewidth=2, join=true)
//plot(topdecay+fallingdecaymultiplier, color=topdecaycolor, style=circles, linewidth=2)
//plot(botdecay-risingdecaymultiplier, color=botdecaycolor, style=circles, linewidth=2)
plot(hidetopmargin ? na : tmargin, color=topdecaycolor, style=linebr, linewidth=1, join=true)
plot(hidebottommargin ? na : bmargin, color=botdecaycolor, style=linebr, linewidth=1, join=true)
Funny. On bitcoin, it creates one green line across the bottom from the start period and thats it. Guess it's saying BTC is a bubble.
Cevap Gönder
@pgsql, :D youll have to match its speed try a multiplier of 10000,
Cevap Gönder
Cool indicator, helps a lot. Do any of the colours or lines Repaint?
Cevap Gönder
@JayP2577, it doesnt repaint
Cevap Gönder
thx, let me know if you guys find improvements or suggestions :)
Cevap Gönder
Indeed, interesting...I'll compare it to my manual lines :)
Thanks for sharing!
Cevap Gönder
I really like what you have done here Ricardo !!! Job well done. Thanks for sharing.
Cevap Gönder
Ana Sayfa Hisse Senedi Takipçisi Forex Takipçisi Kripto Takipçisi Ekonomik Takvim Nasıl Çalışır Grafik Özellikleri Ücretlendirme Kurallarımız Moderatörler Web Sitesi & Aracı Kurum Çözümleri Görsel Bileşenler(Widget) Grafik Çözümleri Destek Merkezi Yeni Özellik Talebi Blog ve Haberler SSS Viki Twitter
Profil Profil Ayarları Hesap ve Ödemeler TradingView Koinleri Destek Kayıtlarım Destek Merkezi Yayınlanmış Fikirler Takip Edenler Takip Ediliyor Özel Mesajlar Sohbet Çıkış