Bug: 6 Hour Chart - Few Bars Back

Created at 04 May 2021, 18:56
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!
JO

Jobauma

Joined 07.10.2020

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


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


@Jobauma
Replies

PanagiotisCharalampous
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


@PanagiotisCharalampous

Jobauma
05 May 2021, 12:18

Hi. :)

Can you elaborate on how to use this method? 

Thanks for your help.

Best regards,

Johannes Hillestad Baumann


@Jobauma

PanagiotisCharalampous
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


@PanagiotisCharalampous

Jobauma
05 May 2021, 12:24

Hi.

Thank you so much. :)

Best regards,

Johannes Hillestad Baumann


@Jobauma