Bars.LoadMoreHistory();

Created at 07 Apr 2020, 18:04
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!
12

1222Ht

Joined 11.11.2017

Bars.LoadMoreHistory();
07 Apr 2020, 18:04


Hi, Thank you very much for reading my question .

Im wondering :

---------------------------------------------------------------

  protected override void Initialize()
        {
            if (Bars.Count < 3500)
                Bars.LoadMoreHistory();

...

        }

What would happen if specific symbol + timeframe doesnt have this amount of bar 

Thank you very much.


@1222Ht
Replies

PanagiotisCharalampous
08 Apr 2020, 08:20

Hi 1222Ht,

Your question is not very clear. The if statement does not affect the number of bars to be loaded. If you want to load up to specific number of bars you need to use a while statement. However if the symbol does not contain that amount of bars, you will end up in an infinite loop. Therefore you need to implement the relevant check to break the loop when all bars have been loaded.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

1222Ht
09 Apr 2020, 06:18

Hi Panagiotis ,

Thank you very much for your reply . sorry that i didnt quite say my problem clearly . but i think your reply is useful. Thank you !


@1222Ht