OrglobalFx_Waddah_Attah_Edited_v1_0 free

by orglobalng in category Other at 03/03/2021
Description

OrglobalFx_Waddah_Attah_Edited_v1_0 
Telegram: @orglobalng

Donate

Reference from Waddah Attah Explosion 

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

 

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
/////////////////////////////////////////////////////////////////
//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;

        }
    }
}
Comments
0