Bars.LoadMoreHistory()'s problem on my pc
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 .
Replies
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
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