Bars.LoadMoreHistory()'s problem on my pc

Created at 26 Feb 2020, 05:46
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()'s problem on my pc
26 Feb 2020, 05:46


Hi, Thank you very much for reading my question .

I use this method to load more bars than 2500 . This is such an amazing method ,

if (Bars.Count < 2500)
                Bars.LoadMoreHistory();

Is this the way to correctly use it ? When i use it like this in EURUSD hour 1 , this is fine . however on my pc , i guess that when i use it on some less popular time frame, CADJPY min 45 ,  some indicator shifts to the right .. and this happens to hour 6 and a few more time frames too on my pc .

The EMA is a 20 period , close EMA . that is not coded within the same indicator as bars.load. I added it from the left hand side indicator lists from cTrader that defaultly exists.  

Thank you very much .


@1222Ht
Replies

PanagiotisCharalampous
26 Feb 2020, 08:54

Hi 1222Ht,

Can you please provide the complete code you are using and exact steps to reproduce the problem?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

1222Ht
26 Feb 2020, 11:44

Hi Panagiotis,

Thank you for your reply . May you please try this to see if you reproduce same problem as well : 

 

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

        ExponentialMovingAverage EMA;

        protected override void Initialize()
        {
            if (TimeFrame != TimeFrame.Minute45)
                Chart.TryChangeTimeFrame(TimeFrame.Minute45);

            if (Bars.Count < 2500)
                Bars.LoadMoreHistory();

            EMA = Indicators.ExponentialMovingAverage(Bars.ClosePrices, 20);
        }

        public override void Calculate(int index)
        {
            Result[index] = EMA.Result[index];
        }

 

This doesnt cause problems on every time frame on my pc  "hour 1", .. but  not m45 , h3  h6.. or some more...

Thank you   


@1222Ht