Category Trend  Published on 30/05/2021

Moving average with cloud

Description

Hello, this code is for the outher author. His name: Panagiotis Charalampous. This indicator was published on this site, on this page: cTDN Forum - Moving average cloud (ctrader.com). I decided to publish because I had lost the address of the post, so if someone uses the indcador, can download it from here directly, without having to create it on the platform through the code provided in the request of the page I reported. I'm informing the author and the page where the code is, I believe they don't break any rules that way. Indicators from this images: Keltner channels, Rounded numbers, Tail renko (Poshtrader site), and moving average cloud for this post.

 

Moving average with clouds in renko chart

 

Ger30


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.Reflection;
using System.Linq;

namespace cAlgo
{
    [Cloud("Fast MA", "Slow MA", FirstColor = "Green", Opacity = 0.5, SecondColor = "Red")]
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Movingaveragecloud : Indicator
    {
        [Parameter("Fast MA Period", DefaultValue = 21)]
        public int FastMaPeriod { get; set; }

        [Parameter("Slow MA Period", DefaultValue = 50)]
        public int SlowMaPeriod { get; set; }

        [Output("Fast MA", LineColor = "#FF6666")]
        public IndicatorDataSeries FastMaResult { get; set; }

        [Output("Slow MA", LineColor = "#0071C1")]
        public IndicatorDataSeries SlowMaResult { get; set; }

        SimpleMovingAverage FastMa;
        SimpleMovingAverage SlowMa;


        protected override void Initialize()
        {
            FastMa = Indicators.SimpleMovingAverage(Bars.ClosePrices, FastMaPeriod);
            SlowMa = Indicators.SimpleMovingAverage(Bars.ClosePrices, SlowMaPeriod);
        }

        public override void Calculate(int index)
        {
            FastMaResult[index] = FastMa.Result[index];
            SlowMaResult[index] = SlowMa.Result[index];
        }
    }
}


CO
contatofredy@hotmail.com

Joined on 22.12.2018

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