MarketSeries.Close.Last(0) data quality highly questionable

Created at 24 Apr 2018, 12:55
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!
CE

ceakuk

Joined 19.03.2018

MarketSeries.Close.Last(0) data quality highly questionable
24 Apr 2018, 12:55


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

namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class TestDataIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

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


        protected override void Initialize()
        {
        }

        public override void Calculate(int index)
        {
            Print("index=" + index + "  current time=" + MarketSeries.OpenTime.Last(0) + "  current data value " + MarketSeries.Close.Last(0));
        }
    }
}

Please have a look. I print  historicdata time and value. I counter check the value with the charts and they differ alot like 1.21954 against chart 1.3XXX for 18th October 2012 at around  8pm. Thanks in advance.

I'm I doing something wrong. Thanks

 


@ceakuk
Replies

PanagiotisCharalampous
24 Apr 2018, 14:08 ( Updated at: 21 Dec 2023, 09:20 )

Hi ceacuk,

Are you sure you have posted the correct indicator? Because I see different messages in log and they seem correct after checking. See below

Best Regards,

Panagiotis


@PanagiotisCharalampous

ceakuk
24 Apr 2018, 15:00

RE:

Exactly. look at your log file . it says time 8/13/2017,  current data value= 1.18214.

However in the chart the values range from 1.2125 to 1.2425. way higher than the 1.18214.

Thats why i question the data


@ceakuk

PanagiotisCharalampous
24 Apr 2018, 15:19

Hi ceakuk,

The values in the log are correct. This is how it is supposed to work. If Calculate() is not executing on the Last Bar, it will consider as last values, the values of the candlestick with the index evaluated. That is why you see the values incrementing by one hour each time.

I hope this clarifies things for you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ceakuk
24 Apr 2018, 15:29

RE:

I think you don't get me. so if calculate does not find data it takes the next index?

well I have looked at say hourly data and the last value in LOG is either so big or so small there is no other suck close in the next  many months none .

I mean 1.18214 in the log is way out of range of 1.2125 to 1.2425 by probably mana many months .

 


@ceakuk

PanagiotisCharalampous
24 Apr 2018, 15:34 ( Updated at: 21 Dec 2023, 09:20 )

Hi ceakuk,

1.18214 is the Close value for the 13/08/2017 22:00 as specified in the log. See graph below

It represents the first value evaluated by that indicator, at index 0, which at that moment is the last value of the series as well.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ceakuk
24 Apr 2018, 15:49

I'm sorry it seams to work now though i dont know why. but it was obvious that for H! data to go far into index=1  is in 2012 is  too much back in time. Sorry for the inconvenience


@ceakuk