BUG! Missing Monthly bar data

Created at 13 Oct 2022, 18: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!
MA

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


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.


@manoj.clsd.kumar@gmail.com
Replies

Spotware
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

 


@Spotware

manoj.clsd.kumar@gmail.com
14 Oct 2022, 08:19 ( Updated at: 21 Dec 2023, 09:22 )

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.


@manoj.clsd.kumar@gmail.com

Spotware
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


@Spotware

manoj.clsd.kumar@gmail.com
14 Oct 2022, 17:16 ( Updated at: 21 Dec 2023, 09:22 )

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] = 
        }
    }
}

 

 

 


@manoj.clsd.kumar@gmail.com

Spotware
17 Oct 2022, 09:11

Dear trader,

The M1 data is missing. Please contact the broker.

Best Regards,

cTrader Team


@Spotware

manoj.clsd.kumar@gmail.com
17 Oct 2022, 09:51 ( Updated at: 21 Dec 2023, 09:22 )

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.


@manoj.clsd.kumar@gmail.com