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;
}
}
}
kaneida84
Joined on 25.04.2021
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: QualitativeQuantitativeEv3.algo
- Rating: 0
- Installs: 1969
- Modified: 11/01/2022 21:23
Comments
Please continue to support Drift Hunters and join me in discovering the next exciting things the game has to offer!
Prestige Southern Star is a magnificent residential township project being developed by Prestige Groups on Begur Road in South-East Bengaluru.
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.
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.
تعلم معي أفضل الطرق لتنظيف خزانات المياه من خلال افضل شركة تنظيف خزانات التي تقوم بعملية تنظيف شامل للخزان من أرضيات وجدران إلي جانب التعقيم الفعال لها
شركة تنظيف مسابح
شركة تنظيف مكيفات
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.
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.
I never used Mypaperwriter before, is mypaperwriter reliable? And how happy you are using this paper writing service. My study buddy is Homeworkfor.me.
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.
Global Brandings is one of the best Stand Contractors in Dubai