Category Oscilators  Published on 22/08/2024

RSI Quality indicator

Description

This custom RSI indicator is a derivation of the original RSI. 

You might recall the saying, "If it sings like a duck, walks like a duck, and looks like a duck, it is a duck." This indicator exhibits all the properties of the standard RSI, it is a RSI. 

This derivation, as a formula, includes a quadratic price transformation, achieved by stretching and smoothing the RSI result. 

This RSI is more rational and better at identifying and respecting overbought, oversold levels, and the 50 level of the indicator.  

My mentor refers to it as the RSI-Quality indicator. 


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo.Indicators
{
    [Levels(30, 50, 70)]
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mRSIquality : Indicator
    {
        [Parameter("Period (10)", DefaultValue = 10)]
        public int inpPeriod { get; set; }
        [Parameter("Period Smooth Factor (5)", DefaultValue = 3)]
        public int inpPeriodSmoothFactor { get; set; }

        [Output("RSI-Quality", PlotType = PlotType.Line, LineColor = "Black", Thickness = 1)]
        public IndicatorDataSeries outRSIqyality { get; set; }

        private RelativeStrengthIndex _rsiquality;
        private IndicatorDataSeries _quadratictransformation;


        protected override void Initialize()
        {
            _quadratictransformation = CreateDataSeries();
            _rsiquality = Indicators.RelativeStrengthIndex(
                Indicators.MovingAverage(
                    Indicators.RelativeStrengthIndex(_quadratictransformation, inpPeriod).Result
                    , inpPeriodSmoothFactor, MovingAverageType.Exponential).Result
                , inpPeriod);
        }

        public override void Calculate(int i)
        {
            _quadratictransformation[i] = - (1 - (1- Bars.ClosePrices[i]) * (1 - Bars.ClosePrices[i]));

            outRSIqyality[i] = _rsiquality.Result[i];
        }
    }
}


mfejza's avatar
mfejza

Joined on 25.01.2022

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: mRSIquality.algo
  • Rating: 0
  • Installs: 514
  • Modified: 22/08/2024 09:03
Comments
Log in to add a comment.
No comments found.