Bollinger Band Cloud free

Description

 

Responding to a forum requst on adding clouds to Bollinger Bands: https://ctrader.com/forum/suggestions/20979

If people want any development work done, you can get in contact with us at: development@fxtradersystems.com

Or via the website at: fxtradersystems.com/support/

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
´╗┐using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo
{
    [Cloud("Top", "Bottom")]
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class BollingerBandCloud : Indicator
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("Periods", DefaultValue = 20, MinValue = 1)]
        public int Periods { get; set; }

        [Parameter("Standard Deviations", DefaultValue = 2, MinValue = 0)]
        public double SDs { get; set; }

        [Parameter("Moving Average Type", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType MAType { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Main { get; set; }

        [Output("Top")]
        public IndicatorDataSeries Top { get; set; }

        [Output("Bottom")]
        public IndicatorDataSeries Bottom { get; set; }

        private BollingerBands bollingerBands;
        protected override void Initialize()
        {
            bollingerBands = Indicators.BollingerBands(Source, Periods, SDs, MAType);
        }

        public override void Calculate(int index)
        {
            Main[index] = bollingerBands.Main[index];
            Top[index] = bollingerBands.Top[index];
            Bottom[index] = bollingerBands.Bottom[index];

        }
    }
}
Comments