MarketSeries.Close.Last(0) data quality highly questionable
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
Replies
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
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