BUG! Missing Monthly bar data

manoj.clsd.kumar@gmail.com since: 04 Dec 2019;

  13 Oct 2022, 18:42
BUG! Missing Monthly bar data

Hi, It seems MarketData.GetBars() sometimes misses entire bars, it becomes a problem, especially if you're getting monthly data because it is very easy to notice an enitre month of missing data:

See:



As can be seen it is completely missing the bar that starts on August 31st, and ends September 1st!

I noticed this as I tried to calculate pivots for each month, and ended up with a central pivot nowhere near the candlesticks in the previous period, and realised it was using data from one period before (ie; there is a missing bar).

Please advise any work arounds to this.

Spotware's avatar

Spotware since: 23 Sep 2013;

  14 Oct 2022, 07:45

Dear trader,

Did you check the charts? Is the monthly bar missing from the chart as well? If yes, then this is a problem of the data and not of the method.

Best Regards,

cTrader Team

TRADERS FIRST™ Vote for your favorite features: https://ctrader.com/forum/suggestions

manoj.clsd.kumar@gmail.com since: 04 Dec 2019;

  14 Oct 2022, 08:21
RE:

Spotware said:

Dear trader,

Did you check the charts? Is the monthly bar missing from the chart as well? If yes, then this is a problem of the data and not of the method.

Best Regards,

cTrader Team

The data IS visible in the chart, the candles are visible in the chart.

Just getBars(), does not return that bar.

Please see if this can be reproduced. The pair is USDZAR.
Broker is ICMarket.

Spotware's avatar

Spotware since: 23 Sep 2013;

  14 Oct 2022, 09:31

Hi there,

Can you provide a small source code example that reproduces the problem so that we can check?

Best regards,

cTrader Team

TRADERS FIRST™ Vote for your favorite features: https://ctrader.com/forum/suggestions

manoj.clsd.kumar@gmail.com since: 04 Dec 2019;

  14 Oct 2022, 17:16
RE:

Spotware said:

Hi there,

Can you provide a small source code example that reproduces the problem so that we can check?

Best regards,

cTrader Team

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;

namespace cAlgo
{
    [Indicator(AccessRights = AccessRights.None)]
    public class SampleUSDZAR : Indicator
    {
        [Parameter(DefaultValue = "Hello world!")]
        public string Message { get; set; }

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

        protected override void Initialize()
        {
            Bars monthBars = MarketData.GetBars(TimeFrame.Monthly);
                          monthBars.ToList().GetRange(monthBars.Count()-5,5).ForEach((el)=>{
                Print($"{el.OpenTime.ToLongDateString()} -- {el.Low}");
              });
                Print("---");

        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = 
        }
    }
}

Spotware's avatar

Spotware since: 23 Sep 2013;

  17 Oct 2022, 09:11

Dear trader,

The M1 data is missing. Please contact the broker.

Best Regards,

cTrader Team

TRADERS FIRST™ Vote for your favorite features: https://ctrader.com/forum/suggestions

manoj.clsd.kumar@gmail.com since: 04 Dec 2019;

  17 Oct 2022, 09:51
RE:

Spotware said:

Dear trader,

The M1 data is missing. Please contact the broker.

Best Regards,

cTrader Team


Ahh each timeframe is it's own dataseries of bars, that makes sense!

Thank you for investigating, I will contact the broker.