Category Oscilators  Published on 11/01/2022

Qualitative Quantitative Estimation (QQE

Description

The QQE indicator is a momentum based indicator to determine trend and sideways. This is slightly modified version of https://ctrader.com/algos/indicators/show/169


 


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

namespace cAlgo.Indicators
{
    [Indicator(AccessRights = AccessRights.None)]
    public class QualitativeQuantitativeEv3 : Indicator
    {
        private int _wildersPeriod;
        private int _startBar;
        // private const int SF = 5;
        private ExponentialMovingAverage _ema;
        private ExponentialMovingAverage _emaAtr;
        private ExponentialMovingAverage _emaRsi;
        private RelativeStrengthIndex _rsi;


        private IndicatorDataSeries _atrRsi;
        [Parameter("Source")]
        public DataSeries Source { get; set; }
        [Parameter(DefaultValue = 14)]
        public int Period { get; set; }
        [Parameter("Smooth", DefaultValue = 5)]
        public int SF { get; set; }

        [Output("Main", Color = Colors.Green)]
        public IndicatorDataSeries Result { get; set; }

        [Output("Signal", Color = Colors.Red, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries ResultS { get; set; }

        [Output("Upper", Color = Colors.Gray, LineStyle = LineStyle.DotsRare)]
        public IndicatorDataSeries Upper { get; set; }

        [Output("Lower", Color = Colors.Gray, LineStyle = LineStyle.DotsRare)]
        public IndicatorDataSeries Lower { get; set; }

        [Output("Middle", Color = Colors.Gray, LineStyle = LineStyle.DotsRare)]
        public IndicatorDataSeries Middle { get; set; }

        protected override void Initialize()
        {

            _atrRsi = CreateDataSeries();
            CreateDataSeries();

            _wildersPeriod = Period * 2 - 1;
            _startBar = _wildersPeriod < SF ? SF : _wildersPeriod;

            _rsi = Indicators.RelativeStrengthIndex(Source, Period);
            _emaRsi = Indicators.ExponentialMovingAverage(_rsi.Result, SF);
            _emaAtr = Indicators.ExponentialMovingAverage(_atrRsi, _wildersPeriod);
            _ema = Indicators.ExponentialMovingAverage(_emaAtr.Result, _wildersPeriod);

        }

        public override void Calculate(int index)
        {
            Result[index] = _emaRsi.Result[index];

            if (index <= _startBar)
            {
                ResultS[index] = 0;
                return;
            }

            _atrRsi[index] = Math.Abs(Result[index - 1] - Result[index]);

            double tr = ResultS[index - 1];

            if (Result[index] < ResultS[index - 1])
            {
                tr = Result[index] + _ema.Result[index] * 4.236;

                if (Result[index - 1] < ResultS[index - 1] && tr > ResultS[index - 1])
                    tr = ResultS[index - 1];
            }
            else if (Result[index] > ResultS[index - 1])
            {
                tr = Result[index] - _ema.Result[index] * 4.236;

                if (Result[index - 1] > ResultS[index - 1] && tr < ResultS[index - 1])
                    tr = ResultS[index - 1];
            }

            ResultS[index] = tr;

            Upper[index] = 70;
            Lower[index] = 30;
            Middle[index] = 50;
        }
    }
}


KA
kaneida84

Joined on 25.04.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: QualitativeQuantitativeEv3.algo
  • Rating: 0
  • Installs: 1968
  • Modified: 11/01/2022 21:23
Comments
Log in to add a comment.
FR
franklincarljohnson · 8 months ago

Global Brandings is one of the best Stand Contractors in Dubai

DA
dariohilll8 · 1 year ago

Please continue to support Drift Hunters and join me in discovering the next exciting things the game has to offer!

prestigesouthernstar's avatar
prestigesouthernstar · 1 year ago

Prestige Southern Star is a magnificent residential township project being developed by Prestige Groups on Begur Road in South-East Bengaluru.

NA
naomi.whittaker.naomi · 1 year ago

Since we're talking about homework helpers, I'd like to give mypaperwriter.com a thumbs up since no one write papers for students better than them. I have the most positive experience with this service.

AL
alvina_adolf9 · 2 years ago

When trying to complete the assignment, you will face many issues. However, it is something faced by many students all over the world. That is when you need online academic writing services UK to receive high grades on your project. So, if you need assistance with assignment completion, call us to get our top experts to guide you to the right pathway.

MA
mahmoud.eladwey123 · 2 years ago

تعلم معي أفضل الطرق لتنظيف خزانات المياه من خلال افضل شركة تنظيف خزانات التي تقوم بعملية تنظيف شامل للخزان من أرضيات وجدران إلي جانب التعقيم الفعال لها
شركة تنظيف مسابح
شركة تنظيف مكيفات

CO
cooperdavid7464 · 2 years ago

Need to find all popular esports tournaments? How about opening this site? Here's a list of the best esports tournaments of all time. You just need to click on the link.

EL
elowe9597 · 2 years ago

It was difficult to find someone who can do my homework for me. It's not a problem after my user experience with assignment writing services.

JA
jacobblair147 · 2 years ago

I never used Mypaperwriter before, is mypaperwriter reliable? And how happy you are using this paper writing service. My study buddy is Homeworkfor.me.

https://essayservices.review/reviews/mypaperwriter-review

MO
mollyfox716 · 2 years ago

The topwriting.services said that not all sites could be trusted. I agree with this statement. Anyone should check the modern websites they want to use.