RVI Force indicator free

by mfejza in category Oscilator at 13/09/2022
Description

This indicator is a custom indicator as a product of detrending the original RVI (Relative Vigor Index) indicator, also deriving the bands from the half detrending size.

The propose of indicator is to identify the market sentiment. 

Bullish sentiment when black line is above the bands; Bearish sentiment when black line is below the bands. In case of black line make V shape that mean price action will create HL (higher low) or LH (Lower high). The HL is created when black line is above the red line, the LH is created when black line is below the red line.

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader

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

namespace cAlgo.Indicators
{
    [Levels(0)]
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class mRVIforce : Indicator
    {
        [Parameter(DefaultValue = 14)]
        public int inpPeriodSmooth { get; set; }
        [Parameter(DefaultValue = 10)]
        public int inpPeriodRVI { get; set; }
        [Parameter("Stoch Smooth Type", DefaultValue = MovingAverageType.Exponential)]
        public MovingAverageType inpSmoothType { get; set; }

        [Output("BandMid", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries BandMid { get; set; }
        [Output("BandUp", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries BandUp { get; set; }
        [Output("BandDn", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries BandDn { get; set; }

        private IndicatorDataSeries _openclose, _highlow, _rvi;
        private MovingAverage _ma;


        protected override void Initialize()
        {
            _openclose = CreateDataSeries();
            _highlow = CreateDataSeries();
            _rvi = CreateDataSeries();
            _ma = Indicators.MovingAverage(_rvi, inpPeriodSmooth, inpSmoothType);
        }

        public override void Calculate(int i)
        {
            _openclose[i] = ((Bars.ClosePrices[i] - Bars.OpenPrices[i]) + 2 * (Bars.ClosePrices[i - 1] - Bars.OpenPrices[i - 1]) + 2 * (Bars.ClosePrices[i - 2] - Bars.OpenPrices[i - 2]) + (Bars.ClosePrices[i - 3] - Bars.OpenPrices[i - 3])) / 6;
            _highlow[i] = ((Bars.HighPrices[i] - Bars.LowPrices[i]) + 2 * (Bars.HighPrices[i - 1] - Bars.LowPrices[i - 1]) + 2 * (Bars.HighPrices[i - 2] - Bars.LowPrices[i - 2]) + (Bars.HighPrices[i - 3] - Bars.LowPrices[i - 3])) / 6;

            double num = 0;
            double denum = 0;
            for (int j = 0; j < inpPeriodRVI; j++)
            {
                num += _openclose[i - j];
                denum += _highlow[i - j];
            }
            _rvi[i] = num / denum;

            BandMid[i] = (_rvi[i] - _ma.Result[i]) * 50;
            BandUp[i] = (_rvi[i] - BandMid[i] + _ma.Result[i]) / 2;
            BandDn[i] = (_rvi[i] + BandMid[i] + _ma.Result[i]) / 2;
        }
    }
}
Comments

mikle.jk2009 - September 20, 2022 @ 17:06

Hi. I can give you some very good advice! This is where they can do an essay for you. Only essay writing service work there with lots of experience and only the best works.

leeminho2662000 - September 21, 2022 @ 12:49

This is an excellent article. This is, in my opinion, one of the best posts ever written. Your work is excellent and inspiring. Thank you very much. Weaver game 

 

0