Gioteen Norm free

by kaneida84 in category Trend at 11/01/2022
Description

The Gioteen Norm indicator is a custom oscillating indicator that represents normalized price. It is a rather simple oscillating indicator which is unbounded and oscillates with a midline of zero. This allows the indicator to mimic the movement of price action quite closely.

 

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 = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class GioteenNorm : Indicator
    {

        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter(DefaultValue = 100)]
        public int Periods { get; set; }

        [Parameter("MA Type", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType maType { get; set; }

        [Output("Main")]
        public IndicatorDataSeries output { get; set; }


        private MovingAverage ma;

        protected override void Initialize()
        {
            ma = Indicators.MovingAverage(Source, Periods, maType);
        }

        public override void Calculate(int index)
        {

            double dAPrice = 0;
            double dAmount = 0;
            double dMovingAverage = ma.Result[index];

            for (int j = 0; j < Periods; j++)
            {
                dAPrice = Source[index - j];
                dAmount += (dAPrice - dMovingAverage) * (dAPrice - dMovingAverage);
            }

            double st = Math.Sqrt(dAmount / Periods);

            if (st == 0)
            {
                st = 0.0001;
            }
            output[index] = (Source[index] - ma.Result[index]) / st;

        }

    }
}
Comments
0