Description
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.
using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Levels(0)]
[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;
}
}
}
mfejza
Joined on 25.01.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: mQMASMAdelta.algo
- Rating: 5
- Installs: 646
- Modified: 07/02/2023 12:34
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
WE
Thank you for your post. I have read through several similar topics! However, your article gave me a very special impression, unlike other articles. I hope you continue to have valuable articles like this or more to share with everyone! trap the cat
Re: snake game
That's right! It's a little more price sensitive.