OPEN-SOURCE SCRIPT

RSI Shortened Matrix

164
The "RSI Shortened Matrix️♞🐍" indicator is designed to help traders compare the Relative Strength Index (RSI) and its moving average (MA) for multiple assets, presenting the comparison results in a visual matrix. Here's a detailed description of its features and functionality:

  • Key Features:
    RSI Settings:

    RSI Length: You can specify the period for calculating RSI, with the default being 14.
    Source Data: Typically set to the closing price, but you can choose other data sources.
    Show Divergence: An option to display RSI divergence, though it is turned off by default.
    MA Settings for RSI:

    MA Type: Choose from different types of moving averages like SMA, EMA, Bollinger Bands, SMMA, WMA, and VWMA.
    MA Length: Set the period for the moving average, defaulting to 8.
    Bollinger Bands StdDev: If using Bollinger Bands, adjust the standard deviation multiplier, usually set at 2.0.
    Table Size:

    You can select the size of the table from options like tiny, small, medium, and large.
    Asset Selection:

    Input up to 25 different asset ticker symbols to analyze. The script comes with default assets including BTC, ETH, BNB, and others.

  • Detailed Functionality:
    RSI Calculation:

    The script calculates the Relative Strength Index (RSI) for each selected asset. RSI measures the magnitude of recent price changes to evaluate overbought or oversold conditions in the price of an asset.

    Moving Average (MA) Calculation:

    After calculating the RSI, the script computes the moving average of the RSI, which helps smooth out the data to identify trends more clearly.
    The type and length of the moving average can be customized to suit different trading strategies.

    RSI and MA Calculation for Each Asset:

    The script applies these calculations to each of the selected assets using the specified settings, retrieving daily data for each asset.

  • Creating the Comparison Matrix:

    A matrix table is created to display the comparison results of the RSI MAs of the selected assets.
    The headers of the table are populated with the asset names, both along the top row and the first column.

  • Comparison Logic:

    For each asset, the script calculates the RSI MA value.
    It then compares the RSI MA value of each asset with every other asset.

    The matrix cells show:

    1: If the RSI MA of the row asset is greater than the RSI MA of the column asset and is above 50, indicating stronger momentum.
    0: If the RSI MA of the row asset is not greater than the RSI MA of the column asset or is 50 or below, indicating weaker or neutral momentum.
    The background color of each cell:
    Green: Indicates a 1, meaning the row asset's RSI MA is higher and above 50.
    Red: Indicates a 0, meaning the row asset's RSI MA is not higher or is 50 or below.

  • Purpose and Use:
    Identifying Relative Strength: By comparing the RSI MAs, traders can see which assets have stronger momentum.
    Spotting Trends: The moving average of RSI helps in identifying the underlying trend in momentum.
    Decision Making: This comparison assists traders in making informed decisions about which assets to trade based on their relative strength or weakness.
    Example:
    If the table shows a 1 in the cell where Bitcoin (BTC) is the row asset and Ethereum (ETH) is the column asset, it means Bitcoin's RSI MA is higher than Ethereum's RSI MA and is above 50, suggesting Bitcoin has stronger momentum.
    Conversely, a 0 would indicate that Bitcoin's RSI MA is not higher than Ethereum's or is 50 or below, suggesting weaker or neutral momentum.
    Additional Details:
    The table headers and the first column are filled with the names of the assets.
    The font size for the table cells adjusts based on your selected table size.
    A dummy plot is included to meet the requirement of having at least one plot in the script.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.