Nico.Muselle

[RS][NM]Improved Linear Regression Bull and Bear Power v01

Nico.Muselle Diupdate   
The base code for this indicator was created by RicardoSantos
What I added is a signal line that indicates when to buy and when to sell.

Advised use :
Combine with a zero-lag indicator like ZeroLagEMA_LB by LazyBear (suggested period = 34)
Then use the following Rules of engagement :
Current price > ZLEMA & Signal line of BBP_NM is green : BUY
Current price < ZLEMA & Signal line of BBP_NM is red : SELL Please click the like button if you dig this indicator !
Komentar:
I have found a little calculation error in this script where if there is no data for either bull or bear volume, the indicator will not plot. This has been corrected in version 2

Check out my FREE indicator scripts:
www.tradingview.com/u/Nico.Muselle/

Twitter: twitter.com/NicoMuselle
Skrip open-source

Dalam semangat TradingView, penulis dari skrip ini telah mempublikasikannya ke sumber-terbuka, maka trader dapat mengerti dan memverifikasinya. Semangat untuk penulis! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.

Inggin menggunakan skrip ini pada chart?
//@version=1
// this code uses the Linear Regression Bull and Bear Power indicator created by RicardoSantos
// and adds a signal line 
// Use : if signal line is changes color, you have your signal, green = buy, red = sell
// Advice : best used with a zero lag indicator like ZeroLagEMA_LB from LazyBear
// if price is above ZLEMA and signal = green => buy, price below ZLEMA and signal = red => sell
study(title='[RS][NM]Improved Linear Regression Bull and Bear Power v01', shorttitle='BBP_NM', overlay=false)
window = input(title='Lookback Window:', type=integer, defval=10)

f_exp_lr(_height, _length)=>
    _ret = _height + (_height/_length)

h_value = highest(close, window)
l_value = lowest(close, window)

h_bar = n-highestbars(close, window)
l_bar = n-lowestbars(close, window)

bear = 0-f_exp_lr(h_value-close, n-h_bar)
bull = 0+f_exp_lr(close-l_value, n-l_bar)
direction = bull*2 + bear*2

plot(title='Bear', series=bear, style=columns, color=maroon, transp=90)
plot(title='Bull', series=bull, style=columns, color=green, transp=90)
plot(title='Direction', series=direction, style=line, linewidth=3, color= direction > 0 ? green : red)