PROTECTED SOURCE SCRIPT
MarcoVieira - BB% Oscillator

marco1981
Instagram @marcovieira.oficial
This script creates a custom Bollinger Band % Oscillator (called MarcoVieira BB% Oscillator) for TradingView. It measures how far the price is from the Bollinger Band basis in percentage terms, adds a moving average for smoothing, and provides visual signals for potential reversals, trend strength, and buy/sell opportunities.
# Key Components
1. Inputs
- Bollinger Bands
- length: period for the bands (default 20).
- mult: multiplier for standard deviation (default 2.0).
- Oscillator
- lengthMA: moving average length (default 55).
- ma_type: type of MA (SMA, EMA, HMA, WMA, VWMA).
- Appearance
- Colors for uptrend/downtrend lines.
- Option to show shaded fills.
- Configurable circle size and colors for signals.
- Reference Lines
- Horizontal lines at +1, +0.5, 0, -0.5, -1 for context.
2. Oscillator Calculation
- Basis = SMA of price (src).
- Deviation = standard deviation of price.
- Oscillator (cctbbo) = (\mathrm{price}-\mathrm{basis})/(2\cdot \mathrm{deviation}).
- This normalizes price relative to Bollinger Bands.
- Oscillator MA (cctbbo_ma) = chosen moving average of the oscillator.
3. Plots & Visuals
- Reference Lines: horizontal guides at ±1, ±0.5, and 0.
- Oscillator Line: plotted with dynamic color (up_color if above MA, dn_color if below).
- Oscillator MA Line: plotted in red for trend smoothing.
- Shading:
- Between 0 and +1 (greenish fill).
- Between 0 and -1 (purple fill).
4. Signals
- Reversal Triangles:
- Down triangle at the top when oscillator crosses under +1 (potential long entry).
- Up triangle at the bottom when oscillator crosses over -1 (potential short entry).
- Circles (configurable size):
- Green circle when oscillator MA ≤ -0.5 (oversold zone).
- Orange circle when oscillator MA ≥ +0.5 (overbought zone).
- Candle Coloring:
- Blue candle when oscillator crosses under +1 (buy signal).
- Yellow candle when oscillator crosses over -1 (sell signal).
# Summary
This indicator is essentially a Bollinger Band % Oscillator with enhanced visuals and signals:
- It shows where price sits relative to Bollinger Bands.
- Adds a moving average for smoother trend detection.
- Provides visual cues (lines, fills, triangles, circles, and candle colors) to highlight potential buy/sell zones and reversals.
- Helps traders quickly spot overbought/oversold conditions and possible trend changes.
Instagram @marcovieira.oficial
This script creates a custom Bollinger Band % Oscillator (called MarcoVieira BB% Oscillator) for TradingView. It measures how far the price is from the Bollinger Band basis in percentage terms, adds a moving average for smoothing, and provides visual signals for potential reversals, trend strength, and buy/sell opportunities.
# Key Components
1. Inputs
- Bollinger Bands
- length: period for the bands (default 20).
- mult: multiplier for standard deviation (default 2.0).
- Oscillator
- lengthMA: moving average length (default 55).
- ma_type: type of MA (SMA, EMA, HMA, WMA, VWMA).
- Appearance
- Colors for uptrend/downtrend lines.
- Option to show shaded fills.
- Configurable circle size and colors for signals.
- Reference Lines
- Horizontal lines at +1, +0.5, 0, -0.5, -1 for context.
2. Oscillator Calculation
- Basis = SMA of price (src).
- Deviation = standard deviation of price.
- Oscillator (cctbbo) = (\mathrm{price}-\mathrm{basis})/(2\cdot \mathrm{deviation}).
- This normalizes price relative to Bollinger Bands.
- Oscillator MA (cctbbo_ma) = chosen moving average of the oscillator.
3. Plots & Visuals
- Reference Lines: horizontal guides at ±1, ±0.5, and 0.
- Oscillator Line: plotted with dynamic color (up_color if above MA, dn_color if below).
- Oscillator MA Line: plotted in red for trend smoothing.
- Shading:
- Between 0 and +1 (greenish fill).
- Between 0 and -1 (purple fill).
4. Signals
- Reversal Triangles:
- Down triangle at the top when oscillator crosses under +1 (potential long entry).
- Up triangle at the bottom when oscillator crosses over -1 (potential short entry).
- Circles (configurable size):
- Green circle when oscillator MA ≤ -0.5 (oversold zone).
- Orange circle when oscillator MA ≥ +0.5 (overbought zone).
- Candle Coloring:
- Blue candle when oscillator crosses under +1 (buy signal).
- Yellow candle when oscillator crosses over -1 (sell signal).
# Summary
This indicator is essentially a Bollinger Band % Oscillator with enhanced visuals and signals:
- It shows where price sits relative to Bollinger Bands.
- Adds a moving average for smoother trend detection.
- Provides visual cues (lines, fills, triangles, circles, and candle colors) to highlight potential buy/sell zones and reversals.
- Helps traders quickly spot overbought/oversold conditions and possible trend changes.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.