Bug: 6 Hour Chart - Few Bars Back

Jobauma since: 07 Oct 2020;

  04 May 2021, 18:56
Bug: 6 Hour Chart - Few Bars Back

Hi.

I've noticed that a 6H chart ( not always? ) doesn't load many bars back. My indicators didn't calculate anything; that's how I discovered it. :)

I have to scroll the chart backwards for the indicators to appear automatically.

If anybody has the same issue, please let me know. :)

Best regards,

Johannes Hillestad Baumann

PanagiotisCharalampous's avatar

PanagiotisCharalampous since: 13 Jan 2017;

  05 May 2021, 08:09

Hi Jobauma,

This is a normal behavior. If you need more bars for your indicator to be calculated, just use LoadMoreHistory() method.

Best Regards,

Panagiotis 

Join us on Telegram

Head of Community Management at cTrader

Jobauma since: 07 Oct 2020;

  05 May 2021, 12:18

Hi. :)

Can you elaborate on how to use this method? 

Thanks for your help.

Best regards,

Johannes Hillestad Baumann

PanagiotisCharalampous's avatar

PanagiotisCharalampous since: 13 Jan 2017;

  05 May 2021, 12:22

Hi Jobauma,

Assuming that you need at least 1000 bars for your indicator to be calculated correctly, you can do the below in the Initialize() method

        protected override void Initialize()
        {
            // Initialize and create nested indicators
            if (Bars.Count < 1000)
                Bars.LoadMoreHistory();
        }

Best Regards,

Panagiotis 

Join us on Telegram

Head of Community Management at cTrader

Jobauma since: 07 Oct 2020;

  05 May 2021, 12:24

Hi.

Thank you so much. :)

Best regards,

Johannes Hillestad Baumann