Stop C Trader automatically removing my indicators

Created at 05 Nov 2021, 12:42
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JU

Justine

Joined 05.11.2021

Stop C Trader automatically removing my indicators
05 Nov 2021, 12:42


Why has C trader started automatically removing my supply demand indicator.  It says it slows performance, I am aware of this, but I still want to use the indicator.  How can I stop it automatically removing the indicator from my chart?


@Justine
Replies

PanagiotisCharalampous
05 Nov 2021, 14:53

Hi Justine,

As per the message you receive, some indicators are not appropriately coded and cause serious degradation of performance to cTrader. Unfortunately we cannot allow those indicators to continue running, since they serously affect the stability of the platform. You should reach out to the indicator developer to fix the issue.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 


@PanagiotisCharalampous

kenneyy_eur
05 Nov 2021, 16:30 ( Updated at: 05 Nov 2021, 16:59 )

RE: I have the same issue with cTrader Desktop 4.1 . CancTrader tell us what criteria they have used in determining if an indicator has performance issues?

PanagiotisCharalampous said:

Hi Justine,

As per the message you receive, some indicators are not appropriately coded and cause serious degradation of performance to cTrader. Unfortunately we cannot allow those indicators to continue running, since they serously affect the stability of the platform. You should reach out to the indicator developer to fix the issue.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 

using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class KF_GHL_v3 : Indicator
    {
        [Parameter("Period", DefaultValue = 10)]
        public int Period { get; set; }

        [Parameter(DefaultValue = "High")]
        public DataSeries SourceH { get; set; }

        [Parameter(DefaultValue = "Low")]
        public DataSeries SourceL { get; set; }

        [Parameter(DefaultValue = "Close")]
        public DataSeries SourceC { get; set; }

        [Parameter("Timeframe", DefaultValue = "Minute5")]
        public TimeFrame Timeframe { get; set; }

        [Parameter(DefaultValue = MovingAverageType.Simple)]
        public MovingAverageType MaType { get; set; }


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


        private MovingAverage _smaHigh;
        private MovingAverage _smaLow;

        private int Hld, Hlv;
        private Bars bars;

        protected override void Initialize()
        {
            if(this.Timeframe != this.Chart.TimeFrame)
            {
                bars = MarketData.GetBars(Timeframe);

                while (bars.OpenTimes[0] > Bars.OpenTimes[0])
                    bars.LoadMoreHistory();

                SourceH = bars.HighPrices;
                SourceL = bars.LowPrices;
                SourceC = bars.ClosePrices;
            }

            _smaHigh = Indicators.MovingAverage(SourceH, Period, MaType);
            _smaLow =  Indicators.MovingAverage(SourceL, Period, MaType);
        }

        public override void Calculate(int index)
        {
            var index1 = this.Timeframe == this.Chart.TimeFrame ? index : bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
            if (index1 < 1) return;

            double close = SourceC[index1];
            double smaHigh = _smaHigh.Result[index1 - 1];
            double smaLow = _smaLow.Result[index1 - 1];

            if (close > smaHigh)
                Hld = 1;
            else
            {
                if (close < smaLow)
                    Hld = -1;
                else
                    Hld = 0;
            }

            if (Hld != 0) Hlv = Hld;

            switch(Hlv)
            {
                case -1: Result[index] = smaHigh; break;
                case 0: Result[index - 1] = double.NaN; break;
                case 1: Result[index] = smaLow; break;
            }
        }
    }
}

It is simply plotting a moving average line of a higher timeframe than the current chart.  This is needed when trading!

When this indicator is placed onto a XAUUSD M5 chart and set to the following parameters

Period: 272

MaType: TimeSeries

Timeframe : 15 minutes

Then run back test, that's when the issue occurs


@kenneyy_eur

ClickAlgo
06 Nov 2021, 10:55 ( Updated at: 06 Nov 2021, 11:02 )

One possible cause is below.

.

  while (bars.OpenTimes[0] > Bars.OpenTimes[0])
                    bars.LoadMoreHistory();

.

infinite loop perhaps, this will continue to load data and use all the machines resources until the platform freezes, this could be why the cTrader Sentinal removed the offending indicator.

.

I only had a quick look, but consider checking this code to see if it is causing the probem.


@ClickAlgo

... Deleted by UFO ...