The RSI Bands indicator is a tool designed to calculate and display overbought, oversold, and middle bands based on the Relative Strength Index (RSI).
Its primary purpose is to provide traders with a clue on whether to place limit buy or limit sell orders, or to set stop-loss orders effectively. The bands represent the price levels the asset must reach for the RSI to align with specific thresholds:
Overbought Band: Displays the upper band representing the price level the asset must reach for the RSI to become overbought.
Oversold Band: Displays the lower band representing the price level the asset must reach for the RSI to become oversold.
Middle Band: Displays the middle band representing the price level the asset must reach for the RSI to hit the middle level. It uses both traditional RSI calculations and a dynamic period adjustment mechanism for improved adaptability to market conditions. The script also offers smoothing options for the bands.
Features
Calculates overbought, oversold, and middle bands using RSI values.
Dynamically adjusts the RSI period based on pivot points if enabled.
Offers smoothing options for the bands: EMA, SMA, or None.
Customizable input parameters for flexibility.
Inputs
Source Value: Selects the data source (e.g., close price) for RSI calculation.
Period: Sets the static RSI calculation period. Used if dynamic period is disabled.
Use Dynamic Period?: Toggles the use of a dynamic RSI period.
Pivot Left/Right Length: Determines the range of bars for pivot detection when using dynamic periods.
Dynamic Period Multiplier: Scales the dynamically calculated RSI period.
Overbought Level: RSI level that marks the overbought threshold.
Oversold Level: RSI level that marks the oversold threshold.
Middle Level: RSI level used as a midpoint reference.
Smoothing Type: Specifies the smoothing method for the bands (EMA, SMA, or None).
Smoothing Length: Length used for the selected smoothing method.
Key Calculations
RSI Calculation:
Computes RSI using gains and losses over the specified period (dynamic or static).
Incorporates a custom function for calculating RSI with dynamic periods.
Dynamic Period Adjustment:
Uses pivot points to determine an adaptive RSI period.
Multiplies the base dynamic period by the Dynamic Period Multiplier.
Band Calculation:
Calculates price changes (deltas) required to achieve the overbought, oversold, and middle RSI levels.
The price changes (deltas) are determined using an iterative approximation technique. For each target RSI level (overbought, oversold, or middle), the script estimates the required change in price by adjusting a hypothetical delta value until the calculated RSI aligns with the target RSI. This approximation ensures precise calculation of the price levels necessary for the RSI to reach the specified thresholds.
Computes the upper (overbought), lower (oversold), and middle bands by adding these deltas to the source price.
Smoothing:
Applies the selected smoothing method (EMA or SMA) to the calculated bands.
Plots
Overbought Band: Displays the upper band representing the price level the asset must reach for the RSI to become overbought.
Oversold Band: Displays the lower band representing the price level the asset must reach for the RSI to become oversold.
Middle Band: Displays the middle band representing the price level the asset must reach for the RSI to hit the middle level.
Usage
Choose the source value (e.g., close price).
Select whether to use a dynamic RSI period or a static one.
Adjust pivot lengths and multipliers for dynamic period calculation as needed.
Set the overbought, oversold, and middle RSI levels based on your analysis.
Configure smoothing options for the bands.
Observe the plotted bands and use them to identify potential overbought and oversold market conditions.
ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.