Moving average cloud
Moving average cloud
16 Jun 2019, 08:53
Hi
i was looking for moving average cloud indicator for ctrader unfortunately I didn’t find any like in image attached can anyone please help
thanks for your time
Replies
codey
22 Oct 2020, 21:43
RE: RE:
rahzelh said:
I am looking for the same functionality. cTrader team are you planning to introduce such a feature to draw cloud between 2 moving averages?? Looking forward seeing that soon.
I also need an indicator to show clouds between 2 EMAs which change colour after crossover (green/red)
@codey
PanagiotisCharalampous
23 Oct 2020, 08:39
Hi all,
Here you go
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 CloudExample : 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];
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
rahzelh
18 Apr 2020, 16:02
RE:
I am looking for the same functionality. cTrader team are you planning to introduce such a feature to draw cloud between 2 moving averages?? Looking forward seeing that soon.
@rahzelh