DynamicRS indicator free

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

This indicator showing price average and price intrinsic level without smoothing methods.

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.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mDynamicRS : Indicator
    {
        [Parameter("Periods (200)", DefaultValue = 200)]
        public int inpPeriods { get; set; }

        [Output("DRS", LineColor = "Black", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outDynamicRS { get; set; }
        [Output("DRS Bullish", LineColor = "Green", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries outDynamicRSBullish { get; set; }
        [Output("DRS Bearish", LineColor = "Red", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries outDynamicRSBearish { get; set; }

        private IndicatorDataSeries _drs;


        protected override void Initialize()
        {
            _drs = CreateDataSeries();
        }

        public override void Calculate(int i)
        {
            if (i <= inpPeriods)
            {
                outDynamicRS[i] = _drs[i] = Bars.TypicalPrices[i];
                return;
            }

            _drs[i] = Bars.TypicalPrices[i];

            if (Bars.HighPrices[i] < Bars.HighPrices[i - 1] && Bars.HighPrices[i] < Bars.HighPrices[i - inpPeriods] && Bars.HighPrices[i] < _drs[i - 1])
            {
                _drs[i] = Bars.HighPrices[i];
                outDynamicRSBearish[i] = Bars.HighPrices[i];
            }
            else if (Bars.LowPrices[i] > Bars.LowPrices[i - 1] && Bars.LowPrices[i] > Bars.LowPrices[i - inpPeriods] && Bars.LowPrices[i] > _drs[i - 1])
            {
                _drs[i] = Bars.LowPrices[i];
                outDynamicRSBullish[i] = Bars.LowPrices[i];
            }
            else
            {
                _drs[i] = _drs[i - 1];

                if (_drs[i - 1] == outDynamicRSBullish[i - 1])
                    outDynamicRSBullish[i] = _drs[i - 1];
                else if (_drs[i - 1] == outDynamicRSBearish[i - 1])
                    outDynamicRSBearish[i] = _drs[i - 1];
            }

            outDynamicRS[i] = _drs[i];
        }
    }
}
Comments

harryjacki336 - September 14, 2022 @ 11:39

It must have felt good to watch you recognize this problem, it must have been lovely. Divide the Youth Hoodie We appreciate you providing this important information, which is frequently hard to find. 

boystrong1001 - September 21, 2022 @ 04:28

Information about your support is essential to me and to so many others, Your Indicator Chart is sharp, I have bookmarked this site and will refer to it many times in the future, special thanks. Spend some time trying out the flagle game experience, it will probably improve everyone's judgment. Do you want to join?

0