TradingView
sclark39
27. Febr. 2018 23:10

BBLathe2: Bollinger Band Lathe w/ Elder's Force Index [sclark39] 

Bitcoin / United States DollarCoinbase

Beschreibung

Welcome to the second version of the BBLathe!

This shows Bollinger Bands centered on a horizontal basis, to make it easier to see how volatility is changing and identify squeeze opportunities. By default Bollinger bands are calculated using an exponential moving average and an improved higher precision stdev implementation, but this can be disabled. Version 2 also shows Elder's Force Index as a white histogram, so you can see some volume information to help confirm the power of the bears/bulls. The green/red shadow shows how the Bollinger's basis is changing, and when it is going up there will be a green shadow underneath the basis line (this can be inverted in the settings). There is also price line (yellow) showing the location of the price within the Bollinger Bands.

Use this indicator for trades at your own risk, I made this for fun and it is not a trade recommendation.

That being said, if you like my work please tip me!

ETH: 0xf8E0Ea503B5c833fD4546E7fa2c70EcE42A27C8A

Please comment with feedback and requests!

Versionshinweise

Added option to color the force-index based on if it is positive or negative, as requested by @gianfranco60 !

Versionshinweise

Fixing preview image
Kommentare
phohat
Hi there,
Very nice script...but can you explain why sometimes BB's aren't displaying for some coins (crypto market). Tried to understand it but i can't...

All the best
Chris
sclark39
@phohat, Which ones? I can check it out.

My guess is because they're priced either really high or really low compared to stocks. I already added a fix for some cryptocurrency, but I haven't tested it in a while. I mostly use this for stocks.
phohat
@sclark39,
Typically like TRX/BTC and/or SNT/BTC on Bittrex.
Bands reappear sometimes but after a long while...

Thank you
Chris
michl
very nice script ... but does someone know, how calculating BB's was meant by John Bollinger? With or without Bessel's correction?
sclark39
@michl, I'm not sure, I'd love to know.

My understanding of it is that Bessel's correction is needed when the calculation uses the mean of a sample like this rather than calculating the mean for the entire population. It reduces the bias and I think makes the calculation more accurate.
gianfranco60
Is is a good chart but I think you should change the colour of the colomns when the volume is below zero
sclark39
@gianfranco60, Done. I've added the option in the input settings. Check it out!
syracusepro
The function: stdev2( mean, src, len ) => sqrt( sum( pow( src - mean, 2 ), len ) / ( len - 1 ) ) has mean as a parameter, so it is taking mean from the boll function then?
sclark39
@syracusepro, Ah, yes. The mean is calculated in the boll function on line 28. By default it is the EMA of the close price over 20 bars. It is passed in like this because you should use the same mean value for calculating the stdev as you use for the basis.

This is using the two-pass algorithm for stdev, with Bessel's correction. It is mathematically equivalent to Pine's version, but doesn't suffer from the same precision issue. If you want to see more about that, check my comments here:
tradingview.com/script/u8FNopNl-META-STDEV-Study-Scripting-Exercise/
Mehr