Category Trend  Published on 29/06/2023

IR Moving Cloud

An update for this algorithm is currently pending moderation. Please revisit this page shortly to access the algorithm's latest version.
Description

 moving average cloud.

you could change cloud color.

to disable cloud just set color as transparent.

update: NET 6
Telegram Channle

support us for more free indicator and bot by sign up in LiteFinance broker from this link

LiteFinance Signup




IR
IRCtrader

Joined on 17.06.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: IR Moving Cloud.algo
  • Rating: 5
  • Installs: 497
  • Modified: 25/08/2023 07:41
Comments
Log in to add a comment.
TV
tvan07 · 6 months ago

Hi, thank you for the indicator! Could you please add a shift field for each MA?

DX
dxhcti.xxx · 2 years ago

Hey, amazing job with the indicator! Would be possible to get the previous version? The trader simulator does not work with NET6 cTrader! Thanks mate 

JE
jennifergarnerphd · 2 years ago

Need to Can I Hire Someone To Do My Online Class? Take Your Class Online offers best online class help! Just say take my online class for me. We offer do my online class help!

OP
opit78 · 2 years ago

@khoshroomahdi of course you can use it

IR
IRCtrader · 2 years ago

@opit78 how could we have sepeate color for cloud and moving average? for example: different color for fast ema and up cloud.

IR
IRCtrader · 2 years ago

@opit78

May i Use your code to update this indicator?

OP
opit78 · 2 years ago

Hi.

You made this code too complicated.

Yes, you can change cloud's color without need of changing the code.

Just analize mine:

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

namespace cAlgo
{
    [Cloud("1st MA Color", "2nd MA Color", Opacity = 0.3)]
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class BartMACloud : Indicator
    {
        [Parameter("1st MA Source", Group = "1st Moving Average")]
        public DataSeries ASource { get; set; }

        [Parameter("1st MA Type", Group = "1st Moving Average", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType AMAType { get; set; }

        [Parameter("1st MA Period", Group = "1st Moving Average", DefaultValue = 5)]
        public int AMAPeriod { get; set; }

        [Parameter("2st MA Source", Group = "2nd Moving Average")]
        public DataSeries BSource { get; set; }

        [Parameter("2nd MA Type", Group = "2nd Moving Average", DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType BMAType { get; set; }

        [Parameter("2nd MA Period", Group = "2nd Moving Average", DefaultValue = 34)]
        public int BMAPeriod { get; set; }

        [Parameter("Show arrows", Group = "Arrows", DefaultValue = false)]
        public bool ShowArrows { get; set; }

        [Parameter("Arrows offset", Group = "Arrows", DefaultValue = 10, MinValue = 1)]
        public int Offset { get; set; }

        [Output("1st MA Color", LineColor = "Lime", PlotType = PlotType.Line, Thickness = 1)]
        public IndicatorDataSeries AMaResult { get; set; }

        [Output("2nd MA Color", LineColor = "Red", PlotType = PlotType.Line, Thickness = 1)]
        public IndicatorDataSeries BMaResult { get; set; }

        MovingAverage AMa;
        MovingAverage BMa;

        private double arrowOffset;


        protected override void Initialize()
        {
            AMa = Indicators.MovingAverage(ASource, AMAPeriod, AMAType);
            BMa = Indicators.MovingAverage(BSource, BMAPeriod, BMAType);

            arrowOffset = Symbol.PipSize * Offset;
        }

        public override void Calculate(int index)
        {
            AMaResult[index] = AMa.Result[index];
            BMaResult[index] = BMa.Result[index];

            if (ShowArrows)
            {
                double high = Bars.HighPrices[index];
                double low = Bars.LowPrices[index];

                if (AMa.Result.Last(1) > BMa.Result.Last(1) && AMa.Result.Last(2) < BMa.Result.Last(2))
                {
                    Chart.DrawIcon("Up" + index, ChartIconType.UpArrow, index - 1, low - arrowOffset, Color.Green);
                }

                if (AMa.Result.Last(1) < BMa.Result.Last(1) && AMa.Result.Last(2) > BMa.Result.Last(2))
                {
                    Chart.DrawIcon("Down" + index, ChartIconType.DownArrow, index - 1, high + arrowOffset, Color.Red);
                }
            }
        }
    }
}