Generalized Bollinger Bands %B And Bandwidth (Tartigradia)Bollinger Band is simply a representation of the rolling average of price and its standard deviation around the average (called the "basis").
This indicator generalizes the Bollinger Band by implementing many different equations to calculate the Bollinger Bands beyond the standard deviation and sma, and then plot the %B (where the current price falls inside the Bollinger Band), Bandwidth (size of the Bollinger Band) as well as the Bollinger Band itself and a reproduction of the OHLC price candles in a separate pane.
Whereas other Bollinger Bands indicators often just change the basis but not the stdev calculation, the correct way to change the basis is to also change it inside the stdev calculation.
Advanced features such as temporal discounting (ie, newer bars can have more weights), median absolute deviation and multiple sigma bands (eg, 3-sigma) are available.
Up to 3 different Bollinger Bands can be displayed, and the background can be highlighted when price is overbought/oversold (beyond the Bollinger Band of choice). Tip: BB3, which is the bollinger band with standard deviation of 3, which represents 99% of observed values in the lookback period, is a good choice to highlight overbought/oversold conditions.
Three "Sentiment Bars" are provided to see at a glance the sentiments on the price action relative to the Bollinger Bands as reflected by the %B value.
Usage:
Use the %B as a measure of sentiment: bullish if > 0.5, bearish if < 0.5. You can use the Sentiment Bars at the bottom for a quick reference: aqua if bullish, red if bearish, gray if undefined (too close to the middle line).
Use the bandwidth as a measure of volatility: higher is more volatile, lower is less.
When overbought, it can be a good time to sell/short. Use a higher Bollinger Band Multiplier such as 3 or more to reduce false positives.
When oversold, it can be a good time to buy/long. Use a higher Bollinger Band Multiplier such as 3 or more to reduce false positives.
Consider setting a much tighter lookback period of 4 as recommended in backtested works (en.wikipedia.org), use zlma instead of sma, and finally set a higher timeframe for the Bollinger Bands than the one you are currently studying. Then, the Bollinger Bands can help in detecting overbought and oversold regions (price going "out of bands").
Note that I tried to automate the setting of a higher timeframe, but for some reason the output is different when I manually do it using request.security() than when it's in indicator(timeframe=""). If someone has any suggestion as to why it happens, please let me know! (You can try it for yourself by uncommenting the auto_timeframe parameter line).
Bandes de Bollinger %B (%B)
Simple Bollinger Band Width PercentileI'm a big fan of The_Caretaker's BBWP and wanted to add it as a volatility indicator to some of my scripts, but since it is over 100 lines of code (plus spacing and comments) I wanted to find if there was a simpler way to get comparable results. SBBWP uses Pine 5 built in functions that I don't believe were available when The_Caretaker wrote BBPW. The main limitations compared to The_Caretaker's version is that it can only use SMA as its Basis Type and the colors are also not as pretty. I have not included alerts or scale lines since I'm not trying to replace BBWP, just give a simple example that you can easily build in to your scripts.
Full credit and respect to The_Caretaker!
Compare Crypto Bollinger Bands//This is not financial advice, I am not a financial advisor.
//What are volatility tokens?
//Volatility tokens are ERC-20 tokens that aim to track the implied volatility of crypto markets.
//Volatility tokens get their exposure to an asset’s implied volatility using FTX MOVE contracts.
//There are currently two volatility tokens: BVOL and IBVOL.
//BVOL targets tracking the daily returns of being 1x long the implied volatility of BTC
//IBVOL targets tracking the daily returns of being 1x short the implied volatility of BTC.
/////////////////////////////////////////////////////////////////
CAN USE ON ANY CRYPTO CHART AS BINANCE:BTCUSD is still the most dominant crypto, positive volatility for BTC is positive for all.
/////////////////////////////////////////////////////////////////
//The Code.
//The blue line (ChartLine) is the current chart plotted on in Bollinger
//The red line (BVOLLine) plots the implied volatility of BTC
//The green line (IBVOLLine) plot the inverse implied volatility of BTC
//The orange line (TOTALLine) plots how well the crypto market is performing on the Bolling scale. The higher the number the better.
//There are 2 horizontal lines, 0.40 at the bottom & 0.60 at the top
/////////To Buy
//1. The blue line (ChartLine) must be higher than the green line (IBVOLLine)
//2. The green line (IBVOLLine) must be higher than the red line (BVOLLine)
//3. The red line (BVOLLine) must be less than 0.40 // This also acts as a trendsetter
//4. The orange line (TOTALLine) MUST be greater than the red line. This means that the crypto market is positive.
//5.IF THE BLUE LINE (ChartLine) IS GREATER THAN THE ORANGE LINE (TOTALLine) IT MEANS YOUR CRYPTO IS OUTPERFOMING THE MARKET {good for short term explosive bars}
//6. If the orange line (TOTALLine) is higher than your current chart, say BTCUSD. And BTC is going up to. It just means BTC is going up slowly. it's fine as long as they are moving in the same position.
//5. I use this on the 4hr, 1D, 1W timeframes
///////To Exit
//1.If the blue line (ChartLine) crosses under the green line (IBVOLLine) exit{ works best on 4hr,1D, 1W to avoid fakes}
//2.If the red line crosses over the green line when long. {close positions, or watch positions} It means negative volatility is wining
Bollinger Bands %B Compare VixThis imple script converts your chosen chart price and outputs it as a percentage in relation to the Vix percentage.
If price (Blue line) is higher than 0.60 and vix (Red Line) is lower than 0. 40 then there is lower volatility and this is good for buying.
If price (Blue line) is lower than 0. 40 and vix (Red Line) is higher than 0.60 then there is higher volatility and this is good for selling, exiting and cash only.
If you like risk you can enter as soon as the price and vix cross in either direction
This is my first script, please give me a lot of critique, I won't cry hahaha :)
For greater accuracy, you use these Vix products for their specific stocks/Indicies:
Apple - VXAPL
Google - VXGOG
Amazon - CBOE:VXAZN
IBM - CBOE:VXIBM
Goldman Sachs - CBOE:VXGS
NASDAQ 100 = CBOE:VXN
SP100 - CBOE:VXO
SP500 (3months) - VIX3M
XLE(energy sector) - CBOE:VXXLE
EWZ(brazil etf) - VXEWZ
EEM( emerging markets etf) - CBOE:VXEEM
EFA (MSCI ETF) - CBOE:VXEFA
FXI (Cina ETF) - CBOE:VXFXI
[MV] %B with SMA + Volume Based Colored Bars
Entry Signal when %B Crosses with SMA and this is more meaningful if it supports colored bars.
Black Bar when prices go down and volume is bigger than 150% of its average, that indicates us price action is supported by a strong bearish volume
Blue Bar when prices go up and volume bigger than 150% of its average, that indicates us price action is supported by a strong bullish volume
VBC author @KIVANCfr3762
Log Bollinger Bands %BB Oscillator [Krypt]This indicator is almost identical to "Bollinger Bands %BB" except its calculations are performed in logspace and it adds an optional EMA line (after LazyBear's idea).
MFI * %B [seiglerj]Oscillator averaging Money Flow Index and Bollinger Bands' %B
Colored bars indicate buy or sell signals
I have no idea if this is the right way to combine these two, but I'm gonna try it and see what happens
VDUB BB %B REVERSAL_v4.2 revised by JustUncleLThis is an revised Open Public version of Vdub Bollinger Band %B reversal indicator. This version includes optional Divergence Finder with selectable channel width, optional Market Session time highlighting and optional Binary Option expiry markers.