Category Other  Published on 05/08/2021

OrglobalFx_Waddah_Attah_Edited_v1_0

Description

OrglobalFx_Waddah_Attah_Edited_v1_0 
Telegram: @orglobalng

Donate

Reference from Waddah Attah Explosion 

Updated version:https://ctrader.com/algos/indicators/show/2609

 


/////////////////////////////////////////////////////////////////
//OrglobalFx_Waddah_Attah_Edited_v1_0 
// orglobalng@gmail.com
// Reference from Waddah Attah Exploasion                       
//
////////////////////////////////////////////////////////////////


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using System.Net;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.EasternStandardTime, AccessRights = AccessRights.None)]
    public class OrglobalFx_Waddah_Attah_Edited_v1_0 : Indicator
    {
        [Parameter("Sensitivity", DefaultValue = 150)]
        public int Sensitivity { get; set; }
        [Parameter("Fast EMA", DefaultValue = 12)]
        public int FastEMA { get; set; }
        [Parameter("Slow EMA", DefaultValue = 26)]
        public int SlowEMA { get; set; }
        [Parameter("Channel Period", DefaultValue = 20)]
        public int BBPeriod { get; set; }
        [Parameter("Channel Multiplier", DefaultValue = 4)]
        public double BBMultiplier { get; set; }
        [Parameter("Channel Smoothing", DefaultValue = 1)]
        public int BBSmoothing { get; set; }
        [Parameter("DeadZone Multiplier", DefaultValue = 4)]
        public double DZMultiplier { get; set; }
        [Parameter("DeadLine ATR Period", DefaultValue = 100)]
        public int ATRPer { get; set; }

        [Output("UpTrend", LineColor = "Green", PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries UpTrend { get; set; }
        [Output("DownTrend", LineColor = "Red", PlotType = PlotType.Histogram, Thickness = 5)]
        public IndicatorDataSeries DownTrend { get; set; }
        [Output("Explosion Line", LineColor = "Yellow", Thickness = 2)]
        public IndicatorDataSeries ExplosionSmoothed { get; set; }
        [Output("Dead Line", LineColor = "White", Thickness = 1)]
        public IndicatorDataSeries DeadLine { get; set; }

        private MacdCrossOver MACD;
        private BollingerBands BB;
        private AverageTrueRange ATR;
        private WeightedMovingAverage BBSmooth;
        private IndicatorDataSeries Explosion;

        protected override void Initialize()
        {
            Explosion = CreateDataSeries();
            MACD = Indicators.MacdCrossOver(SlowEMA, FastEMA, 9);
            BB = Indicators.BollingerBands(Bars.ClosePrices, BBPeriod, BBMultiplier, MovingAverageType.Weighted);
            ATR = Indicators.AverageTrueRange(ATRPer, MovingAverageType.Exponential);
            BBSmooth = Indicators.WeightedMovingAverage(Explosion, BBSmoothing);
        }

        public override void Calculate(int index)
        {
            double t1 = (MACD.MACD[index] - MACD.MACD[index - 1]) * Sensitivity;
            UpTrend[index] = (t1 >= 0) ? t1 : 0;
            DownTrend[index] = t1 < 0 ? -1 * t1 : 0;
            Explosion[index] = BB.Top[index] - BB.Bottom[index];
            ExplosionSmoothed[index] = BBSmooth.Result[index];
            DeadLine[index] = ATR.Result[index] * DZMultiplier;

        }
    }
}


Orglobalfx01's avatar
Orglobalfx01

Joined on 03.03.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: OrglobalFx_Waddah_Attah_Edited_v1_0.algo
  • Rating: 0
  • Installs: 1156
Comments
Log in to add a comment.
No comments found.