QMASMAdelta indicator free

by mfejza in category Volatility at 07/02/2023

QMASMAdelta is a volatility indicator based on the quadratic moving average and this indicator is compared it with standard deviation indicator, but is a bit more sensitive in price.

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
    [Indicator(AccessRights = AccessRights.None)]
    public class mQMASMAdelta : Indicator
        [Parameter("Periods (14)", DefaultValue = 100)]
        public int inpPeriods { get; set; }

        [Output("QMA/SMA Delta", LineColor = "Black", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries outQMASMAdelta { get; set; }
        private SimpleMovingAverage _sma, _pma;
        private IndicatorDataSeries _pow;

        protected override void Initialize()
            _pow = CreateDataSeries();
            _sma = Indicators.SimpleMovingAverage(Bars.ClosePrices, inpPeriods);
            _pma = Indicators.SimpleMovingAverage(_pow, inpPeriods);

        public override void Calculate(int i)
            _pow[i] = Math.Pow(Bars.ClosePrices[i],2);
            outQMASMAdelta[i] = (Math.Sqrt(_pma.Result[i]) - _sma.Result[i]) / Symbol.TickSize;