PROTECTED SOURCE SCRIPT
已更新

MarcoVieira - Bollinger Band sobre RSI (Long & Short + Alerts)

54
Strategy Summary
This Pine Script strategy combines RSI (Relative Strength Index) with Bollinger Bands applied directly on the RSI values. Instead of using Bollinger Bands on price, it uses them on RSI to detect stronger overbought/oversold signals.

⚙️ How It Works
1. RSI Calculation
• RSI is computed from price changes (default length 14).
• It measures momentum and oscillates between 0–100.
2. Bollinger Bands on RSI
• A moving average of RSI (basis).
• Upper and lower bands are created using standard deviation.
• These bands show when RSI is unusually high or low compared to its average.
3. Entry & Exit Conditions
• Long Entry (LE): RSI drops below the lower band and is very low (<40).
• Long Exit (LX): RSI rises back above the basis or goes above 65.
• Short Entry (SE): RSI rises above the upper band and is very high (>60).
• Short Exit (SX): RSI falls back below the basis or goes under 35.
4. Risk Management
• Dynamic take profit and stop loss levels are calculated as percentages of the entry price.
• This ensures trades are automatically managed.
5. Visual Signals
• Colored markers show entries/exits directly on the RSI chart:
• Green (dark) → Long Entry
• Red (dark) → Long Exit
• Red (light) → Short Entry
• Green (light) → Short Exit
• Blue/orange markers highlight RSI and BB Basis extremes.
6. Alerts
• Alerts trigger for entries, exits, and extreme RSI/BB Basis values.
• This allows automated monitoring without watching the chart constantly.
7. Extras
• Optional plots show cumulative profit/loss (PnL) and current position size.

In Short
This is a Bollinger Band on RSI trading system. It:
• Spots overbought/oversold conditions more dynamically than plain RSI.
• Provides clear entry/exit signals with color-coded markers.
• Automates risk management with TP/SL.
• Sends alerts so you can act quickly or automate trades.
• Helps visualize both momentum and trade performance in one chart.
發行說明
marco1981
Instagram @marcovieira.oficial

# Indicator & Strategy Overview
This is a TradingView strategy that applies Bollinger Bands directly on the RSI (Relative Strength Index) instead of price. It then uses those bands to generate long and short trading signals, manages trades with take‑profit and stop‑loss levels, and provides alerts for key conditions.

⚙️ Key Components
1. RSI Calculation
• Standard RSI is calculated (default length = 14).
• RSI measures momentum by comparing average gains vs. losses.
• Values range between 0 and 100:
• Above 70 → overbought.
• Below 30 → oversold.
2. Bollinger Bands on RSI
• Bollinger Bands are applied to RSI values:
• Basis = SMA of RSI (default length = 20).
• Upper Band = Basis + (StdDev × multiplier).
• Lower Band = Basis − (StdDev × multiplier).
• This creates a dynamic envelope around RSI, showing volatility of momentum.
3. Entry & Exit Logic
• Long Entry:
RSI drops below the lower band and is under 40 → potential oversold reversal.
• Long Exit:
RSI rises above the basis or above 65 → momentum shift, exit long.
• Short Entry:
RSI climbs above the upper band and is over 60 → potential overbought reversal.
• Short Exit:
RSI falls below the basis or below 35 → momentum shift, exit short.
4. Risk Management
• Configurable Take Profit and Stop Loss percentages:
• Long TP default = 10%, SL = 25%.
• Short TP default = 10%, SL = 25%.
• These levels are calculated relative to the entry price.
5. Visuals
• RSI line plotted in green when above basis, red when below.
• Bollinger Bands plotted around RSI with shaded fill.
• Horizontal reference lines at RSI 30, 50, 70.
• Signal markers (entries/exits) plotted with 40% opacity for clarity.
• Optional plots:
• PnL curve (cumulative profit/loss).
• Position size histogram.
6. Alerts
• Alerts trigger for:
• Long entry/exit.
• Short entry/exit.
• RSI extremes (≤30 or ≥70).
• BB basis extremes (≤30 or ≥70).
• These allow automated notifications or integration with trading bots.

# How It Works in Practice
• The strategy looks for RSI extremes relative to its Bollinger Bands.
• When RSI breaks outside the bands, it suggests momentum exhaustion and a possible reversal.
• The script enters trades accordingly, manages them with TP/SL, and exits when RSI returns to more neutral levels.
• Alerts ensure you don’t miss signals even if you’re not watching the chart.
發行說明
marco1981
instagram @marcovieira.oficial

MarcoVieira - RSI Bollinger Bands Indicator
Overview
This is a sophisticated trading strategy that combines RSI (Relative Strength Index) with Bollinger Bands applied directly to the RSI itself. The indicator provides Long/Short signals with customizable Take Profit/Stop Loss levels, multiple visual alerts, and candle coloring for market extremes.

Core Components
1. RSI Calculation
Standard 14-period RSI using closing prices

Plotted as a line that changes color (green/red) based on its position relative to the Bollinger Basis

2. Bollinger Bands on RSI
20-period Bollinger Bands applied to the RSI values

2 standard deviations by default (customizable)

Creates a dynamic envelope around the RSI

3. Entry/Exit Signals
LONG Positions:
Entry: RSI < Lower BB AND RSI < 40

Exit: RSI > BB Basis OR RSI > 65

TP/SL: Customizable percentage levels (default: 10% TP, 25% SL)

SHORT Positions:
Entry: RSI > Upper BB AND RSI > 60

Exit: RSI < BB Basis OR RSI < 35

TP/SL: Customizable percentage levels (default: 10% TP, 25% SL)

Visual Features
1. Plotting:
RSI line with dynamic coloring

Bollinger Bands (Basis, Upper, Lower) with fill

RSI zones (70/50/30 levels) with shaded overbought/oversold areas

2. Signal Markers:
LE/LX (Long Entry/Exit) - Green/Red labels

SE/SX (Short Entry/Exit) - Red/Green labels

Extreme markers for RSI and BB Basis at 30/70 levels

3. Candle Coloring:
Uses priority-based coloring:

BB Basis ≤ 30 → Dark Orange (weak market)

BB Basis ≥ 70 → Purple (strong market)

RSI ≤ 30 → Yellow (oversold)

RSI ≥ 70 → Blue (overbought)

Alert System
Trading Alerts:
📈 Long Entry - RSI below Lower BB and < 40

🔻 Long Exit - RSI crosses above BB Basis or > 65

📉 Short Entry - RSI above Upper BB and > 60

🔺 Short Exit - RSI crosses below BB Basis or < 35

Market Condition Alerts:
⚠️ RSI Extremes - RSI ≤ 30 (oversold) or ≥ 70 (overbought)

📊 BB Basis Extremes - BB Basis ≤ 30 (weak) or ≥ 70 (strong)

Unique Features
1. Pivot Detection:
Detects local tops/bottoms in RSI using pivot functions

Identifies reversions after extreme RSI levels (30/70)

2. Dual Analysis:
RSI momentum + Bollinger Band volatility on same oscillator

Provides both overbought/oversold and volatility expansion/contraction signals

3. Customization:
Adjustable RSI length, BB periods, and standard deviations

Configurable TP/SL percentages for risk management

Optional PnL and position size plotting

Trading Logic
Strategy Type:
Mean Reversion combined with Breakout

Market Conditions:
Best for: Ranging/oscillating markets

Works well with: Strong mean reversion tendencies

Caution in: Strong trending markets without pullbacks

Risk Management:
Pyramiding: Disabled (1 position at a time)

Position Sizing: Fixed cash amount ($1000 default)

Stop Loss: Essential (25% default for protection)

Key Insights
Confluence Signals:
Strong BUY: RSI < Lower BB + RSI < 40 + BB Basis ≤ 30

Strong SELL: RSI > Upper BB + RSI > 60 + BB Basis ≥ 70

Exit Timing:
Exits when RSI returns to BB Basis (mean reversion complete)

Can capture middle portion of mean reversion moves

Multi-Timeframe Utility:
Can be used on various timeframes

Shorter timeframes → more signals, more noise

Longer timeframes → fewer signals, higher reliability

Pros & Cons
Advantages:
✅ Clear visual signals with multiple confirmations
✅ Built-in risk management (TP/SL)
✅ Identifies market extremes effectively
✅ Works across multiple asset classes
✅ Customizable parameters for different trading styles

Limitations:
❌ May generate false signals in strong trends
❌ Requires market with mean reversion characteristics
❌ RSI alone can remain extended in trending markets
❌ BB Basis extremes might lag price action

Recommended Settings
For Day Trading:
RSI Length: 10-14

BB Length: 14-20

TP: 5-15%, SL: 15-30%

For Swing Trading:
RSI Length: 14-21

BB Length: 20-30

TP: 10-20%, SL: 20-40%

For Crypto:
Use wider BB (2.5-3.0 std dev) due to higher volatility

Consider larger SL (30-50%) for volatile assets

Summary
The MarcoVieira BB/RSI indicator is a powerful mean reversion tool that combines the momentum-reading capability of RSI with the volatility-based Bollinger Bands. It's particularly effective in:

Identifying oversold/overbought conditions with multiple confirmations

Timing entries when RSI moves outside Bollinger Bands

Managing exits when mean reversion completes

Visualizing market strength through BB Basis levels

Best used as part of a comprehensive trading system with additional trend filters and volume confirmation for optimal results.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。