Category Oscilators  Published on 11/04/2024

The Double RSI (innovative calculation method)

Description

The DoubleRSI (innovative calculation method)

This indicator utilizes an innovative calculation method that combines the inverted slow RSI with the fast RSI, potentially enabling the identification of overbought/oversold zones even during an uptrend.

Inverted Slow RSI: The slow RSI is inverted to reflect market trends oppositely. During an uptrend, it is kept below 50, while during a downtrend, it is kept above 50. This inversion may potentially assist in better capturing market fluctuations and identifying overbought/oversold zones more precisely.

Fast RSI: The fast RSI is used to rapidly identify overbought and oversold zones. However, during an uptrend, it may not always reach traditional overbought levels (e.g., 70) due to market dynamics. By combining the fast RSI with the inverted slow RSI, the indicator may potentially compensate for this limitation by allowing the fast RSI to reach the necessary levels to identify overbought/oversold zones.

Combination of RSIs: The values of the inverted slow RSI and the fast RSI are added together to obtain a composite value. This combination may potentially provide more comprehensive and reliable signals, thus potentially enabling the indicator to effectively identify overbought/oversold zones, even when the fast RSI alone fails to reach traditional thresholds.

In summary, the DoubleRSI indicator utilizes a sophisticated calculation approach that may potentially assist in accurately identifying overbought/oversold zones, even during an uptrend. This method may potentially provide traders with additional insights to make informed trading decisions in various market conditions.

 

Have fun, and for any collaboration, contact me !!!

On telegram : https://t.me/nimi012 (direct messaging)

 


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Cloud("ResultNormal", "ResultSwitch", FirstColor = "Lime", SecondColor = "Red", Opacity = 0.85)]
    [Levels(70, 50, 30)]
    [Indicator(AccessRights = AccessRights.None)]
    public class DoubleRSI : Indicator
    {
        [Parameter("Rsi Slow", DefaultValue = 255, Group = "Rsi Trend")]
        public int PeriodRsiSlowTrend { get; set; }
        [Parameter("Sensitivity Multiplicator Slow", DefaultValue = 3, Group = "Rsi Trend")]
        public double SensitivityRsiSlowTrend { get; set; }

        [Parameter("Rsi Fast", DefaultValue = 6, Group = "Rsi Fast")]
        public int PeriodRsiFastOverBuySell { get; set; }
        [Parameter("Sensitivity Multiplicator Fast", DefaultValue = 1, Group = "Rsi Fast")]
        public double SensitivityRsiFastOverBuySell { get; set; }

        [Parameter("Smoothing", DefaultValue = 1, Group = "Smooting Setting")]
        public int Smooth { get; set; }
        [Parameter("Ma Type", DefaultValue = 1, Group = "Smooting Setting")]
        public MovingAverageType SmoothMaType { get; set; }


        [Parameter("Show Base Rsi", DefaultValue = false, Group = "Is Needed Base Calculation ?")]
        public bool ShowBaseRsiTrendAndOverBuySell { get; set; }

        [Parameter("Change Base Calculation", DefaultValue = EnumCalculation.Over_Buy_Sell, Group = "Is Needed Base Calculation ?")]
        public EnumCalculation TrendOrOverBuySell { get; set; }
        public enum EnumCalculation
        {
            Trend,
            Over_Buy_Sell
        }
        [Output("ResultRsiFast", LineColor = "Orange")]
        public IndicatorDataSeries ResultRsiFast { get; set; }
        [Output("ResultRsiSlow", LineColor = "DeepSkyBlue")]
        public IndicatorDataSeries ResultRsiSlow { get; set; }


        [Output("ResultNormal", LineColor = "Transparent")]
        public IndicatorDataSeries ResultNormal { get; set; }
        [Output("ResultSwitch", LineColor = "Transparent")]
        public IndicatorDataSeries ResultSwitch { get; set; }

        private RelativeStrengthIndex rsiTrend, rsiOverBuySell;
        private IndicatorDataSeries resTrend, resOverBuySell;
        private MovingAverage smoothTrend, smoothOverBuySell;

        protected override void Initialize()
        {
            rsiTrend = Indicators.RelativeStrengthIndex(Bars.ClosePrices, PeriodRsiSlowTrend);
            rsiOverBuySell = Indicators.RelativeStrengthIndex(Bars.ClosePrices, PeriodRsiFastOverBuySell);
            resTrend = CreateDataSeries();
            resOverBuySell = CreateDataSeries();
            smoothTrend = Indicators.MovingAverage(resTrend, Smooth, SmoothMaType);
            smoothOverBuySell = Indicators.MovingAverage(resOverBuySell, Smooth, SmoothMaType);
        }

        public override void Calculate(int index)
        {

            var rsiTrendNormal = ((rsiTrend.Result[index] - 50) * SensitivityRsiSlowTrend) + 50;
            var rsiTrendSwhitch = ((-(rsiTrend.Result[index] - 50)) * SensitivityRsiSlowTrend) + 50;
            var rsiOverBuySellNormal = ((rsiOverBuySell.Result[index] - 50) * SensitivityRsiFastOverBuySell) + 50;
            var rsiOverBuySellSwhitch = ((-(rsiOverBuySell.Result[index] - 50)) * SensitivityRsiFastOverBuySell) + 50;

            if (ShowBaseRsiTrendAndOverBuySell)
            {
                ResultRsiFast[index] = TrendOrOverBuySell == EnumCalculation.Trend ? rsiOverBuySellNormal : rsiOverBuySellSwhitch;
                ResultRsiSlow[index] = TrendOrOverBuySell == EnumCalculation.Trend ? rsiTrendNormal : rsiTrendSwhitch;
            }

            resTrend[index] = ((rsiTrendNormal - 50) + (rsiOverBuySellNormal - 50)) + 50;
            resOverBuySell[index] = (rsiTrendSwhitch - 50) + (rsiOverBuySellNormal - 50) + 50;

            ResultNormal[index] = smoothTrend.Result.Last(0);
            ResultSwitch[index] = smoothOverBuySell.Result.Last(0);
        }
    }
}

YE
YesOrNot

Joined on 10.10.2022 Blocked

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Double RSI.algo
  • Rating: 0
  • Installs: 200
  • Modified: 11/04/2024 10:52
Comments
Log in to add a comment.
No comments found.