Replies

sandrotame1900
30 Jan 2020, 13:12 ( Updated at: 21 Dec 2023, 09:21 )

RE:

PanagiotisCharalampous said:

Hi sandrotame1900,

Can you please share the indicator with us as well as some steps to reproduce the problem?

Best Regards,

Panagiotis 

Join us on Telegram

 

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SimpleIndicator : Indicator
    {
        [Parameter(DefaultValue = "EURUSD")]
        public string symbName { get; set; }

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

        private MarketSeries ms;

        protected override void Initialize()
        {

            ms = MarketData.GetSeries(symbName, TimeFrame);
        }

        public override void Calculate(int index)
        {
            DateTime dt = MarketSeries.OpenTime[index];
            int indexMS = ms.OpenTime.GetIndexByTime(dt);

            Result[index] = ms.Close[indexMS];
        }
    }
}

Here is an example with a simple indicator that just plot the close of other symbol.

If we add this indicator to the chart while we are in visual backtesting, on cTrader 3.6 there is no problem, indicators load and work normally, but on the 3.7 indicators never load.

Screenshot V3.6

Screenshot V3.7


@sandrotame1900