DonChain Percentage indicator free

by mfejza in category Oscilator at 17/01/2023
Description

DonChain Percentage oscillator displays a relative price position inside the Donchian channel as oscillator.

Remark, indicator above or below level 50 for sentiment zone.

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

namespace cAlgo
{
    [Levels(0, 50, 100)]
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class mDonChainProcent : Indicator
    {
        [Parameter("Periods (20)", DefaultValue = 20)]
        public int inpPeriods { get; set; }

        [Output("DonChain Procent", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
        public IndicatorDataSeries outDonChainProcent { get; set; }        
        
        private DonchianChannel _donchainchannel;
        private IndicatorDataSeries _top, _bottom, _dcprocent;
        

        protected override void Initialize()
        {
            _donchainchannel = Indicators.DonchianChannel(inpPeriods);
            _top = CreateDataSeries();
            _bottom = CreateDataSeries();
            _dcprocent = CreateDataSeries();
        }

        public override void Calculate(int i)
        {            
            _top[i] = i>inpPeriods ? _donchainchannel.Top.Maximum(inpPeriods) : _donchainchannel.Top[i];
            _bottom[i] = i>inpPeriods ? _donchainchannel.Bottom.Minimum(inpPeriods) : _donchainchannel.Bottom[i];
            _dcprocent[i] = ((Bars.ClosePrices[i] - _bottom[i]) / (_top[i] - _bottom[i])) * 100.0;
            
            outDonChainProcent[i] = _dcprocent[i];
        }
    }
}
Comments

alissahnvfjrivas7797 - January 17, 2023 @ 09:59

Why isn't this article getting more readers? I hope a large number of people read this excellent article and are motivated basketball stars

tetewon430 - January 18, 2023 @ 08:06

In essence, the survey aims to learn what consumers think of the company's goods and how satisfied they are with their overall customer support. www Lowes com Survey

0